-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabel.go
49 lines (37 loc) · 928 Bytes
/
Label.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package walkwrap
import (
"github.com/lxn/walk"
// "github.com/lxn/win"
)
type Label struct {
*walk.Label
}
func NewLabel(parent walk.Container, txt string, w, h, x, y int) *Label {
ll := new(Label)
ll.Label, _ = walk.NewLabel(parent)
font, _ := walk.NewFont("微软雅黑", 9, 0)
ll.Label.SetFont(font)
//WS_EX_TRANSPARENT
ll.Label.SetText(txt)
ll.Label.SetWidth(w)
ll.Label.SetHeight(h)
ll.Label.SetX(x)
ll.Label.SetY(y)
//win.SetWindowLongPtr(ll.Label.Handle(), win.GWL_EXSTYLE, win.WS_EX_TRANSPARENT)
return ll
}
type LinkLabel struct {
*walk.Label
}
func NewLinkLabel(parent walk.Container, txt string, w, h, x, y int) *LinkLabel {
ll := new(LinkLabel)
ll.Label, _ = walk.NewLabel(parent)
font, _ := walk.NewFont("微软雅黑", 9, walk.FontUnderline)
ll.Label.SetFont(font)
ll.Label.SetText(txt)
ll.Label.SetWidth(w)
ll.Label.SetHeight(h)
ll.Label.SetX(x)
ll.Label.SetY(y)
return ll
}