Notifications
Clear all
[Closed] dot net label tool tip
Jan 16, 2013 12:50 pm
Hello guys. I’ve got a dot net form with labels. I want a mouse hover over the labels to produce tool tip messages. What’s the quickest way to do this? Or should I be using a dot net button instead? thnx for your patience.
9 Replies
Jan 16, 2013 12:50 pm
and? where is a problem?
try(form.close()) catch()
(
global form = dotnetobject "Form"
form.Text = "Label ToolTips"
form.ShowInTaskbar = off
form.Size = dotnetobject "System.Drawing.Size" 240 60
tt = dotnetobject "ToolTip"
form.controls.addrange \
(
for k=0 to 3 collect
(
local lb = dotnetobject "Label"
lb.Text = "Label" + k as string
lb.Bounds = dotnetobject "System.Drawing.Rectangle" (k*60+2) 4 60 24
tt.SetToolTip lb ("You are over the " + lb.text)
lb
)
)
MaxHandleWrapper = dotnetobject "MaxCustomControls.Win32HandleWrapper" (dotnetobject "System.IntPtr" (windows.getmaxhwnd()))
form.Show MaxHandleWrapper
ok
)
Jan 16, 2013 12:50 pm
Oh settooltip…of course, thnx Denis. What if i wanted a slight shift in the image on hover?
Jan 16, 2013 12:50 pm
I just want the lable image to be offset a few pixels to indicate a mouse click, say, then pop back.
1 Reply
try(form.close()) catch()
(
global form = dotnetobject "Form"
form.Text = "Label ToolTips"
form.ShowInTaskbar = off
form.Size = dotnetobject "System.Drawing.Size" 240 60
fn onMouseDown s e =
(
s.Location.X += 1
s.Location.Y += 1
)
fn onMouseUp s e =
(
s.Location.X -= 1
s.Location.Y -= 1
)
form.controls.addrange \
(
for k=0 to 3 collect
(
local lb = dotnetobject "Label"
lb.Text = "Label" + k as string
lb.Bounds = dotnetobject "System.Drawing.Rectangle" (k*60+2) 4 60 24
dotnet.addEventHandler lb "MouseDown" onMouseDown
dotnet.addEventHandler lb "MouseUp" onMouseUp
lb
)
)
MaxHandleWrapper = dotnetobject "MaxCustomControls.Win32HandleWrapper" (dotnetobject "System.IntPtr" (windows.getmaxhwnd()))
form.Show MaxHandleWrapper
ok
)
are you happy now ? … but all these is easier to do by using flat buttons with no border.
1 Reply
no. tooltip mechanics are the same. but button has some built-in ui solutions. highlight on over, for example. also button has some proprieties that label doesn’t. TextImageRelation is useful one.
1 Reply