473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can i increase the mousehover event timer?

Hi,
How can i increase the mousehover event timer?

AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")

Thanks!!!

Mar 2 '07 #1
12 3768
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?

AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")

Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).

However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?

Thanks,

Seth Rowe

Mar 2 '07 #2
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!

How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).

However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?

Thanks,

Seth Rowe
Thanks Seth,

you are right...Tooltips are much better for me.

Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?

Mar 2 '07 #3
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe

Thanks Seth,

you are right...Tooltips are much better for me.

Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.

Thanks,

Seth Rowe

Mar 2 '07 #4
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:


On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?

The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
OK thanks

Mar 2 '07 #5
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:


On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -

OK thanks- Hide quoted text -

- Show quoted text -
HI,

I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!

any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click

Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)

Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next

ToolTip1.SetToolTip(NewBtn, s)

Mar 2 '07 #6
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -

HI,

I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!

any help is greatly appreciated.

Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click

Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)

Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)

Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next

ToolTip1.SetToolTip(NewBtn, s)
Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.

Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)

Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :

Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub

This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.

Any further questions please ask!

Thanks,

Seth Rowe
Mar 2 '07 #7
On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:


On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)

Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.

Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)

Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :

Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub

This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.

Any further questions please ask!

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
Thank you very much!. extremely good advice.

Mar 2 '07 #8
On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:


On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)

Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.

Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)

Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :

Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub

This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.

Any further questions please ask!

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
Seth,

quick question....if i use a Tag instead of accessiblename how can
search for a specific control without using loop?

Mar 2 '07 #9
On Mar 2, 12:37 pm, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)
Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.
Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)
Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :
Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub
This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.
Any further questions please ask!
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -

Seth,

quick question....if i use a Tag instead of accessiblename how can
search for a specific control without using loop?
It depends - which control are you trying to find and why do you need
to find it?

Thanks,

Seth Rowe

Mar 2 '07 #10
On 2 Mar, 17:49, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 12:37 pm, "Marc" <marc_cro...@hotmail.comwrote:


On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)
Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.
Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)
Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :
Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub
This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.
Any further questions please ask!
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Seth,
quick question....if i use a Tag instead of accessiblename how can
search for a specific control without using loop?

It depends - which control are you trying to find and why do you need
to find it?

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
OK,

so my users can dynamically add buttons to a form...basically i am
trying to allow the users to save text notes to a button. So when the
user double clicks on a button a text box appears.
As multiple buttons can be added i need a way to tie each button to
its text box. When the user creates a button I also create a new text
box automatically. Before i was populating the accessible name
property with the creation date time to tie the two together.

So when a user double clicks the button i was searching through every
control that matches the accessible name to show the appropriate text
box....make sense?

Mar 2 '07 #11
On Mar 2, 12:56 pm, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 17:49, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 12:37 pm, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)
Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.
Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)
Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :
Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub
This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.
Any further questions please ask!
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Seth,
quick question....if i use a Tag instead of accessiblename how can
search for a specific control without using loop?
It depends - which control are you trying to find and why do you need
to find it?
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -

OK,

so my users can dynamically add buttons to a form...basically i am
trying to allow the users to save text notes to a button. So when the
user double clicks on a button a text box appears.
As multiple buttons can be added i need a way to tie each button to
its text box. When the user creates a button I also create a new text
box automatically. Before i was populating the accessible name
property with the creation date time to tie the two together.

So when a user double clicks the button i was searching through every
control that matches the accessible name to show the appropriate text
box....make sense?
Ok, store the richtextbox you want to access in the Tag property of
it's associated button.

Even better you should use my suggestion of putting the button and
textbox into a user control and adding the user control at runtime
instead of the button and textbox. That way the usercontrol manages
it's controls (the textbox and button) while the form only has to
worry about adding the usercontrols. Is there something you don't
understand about this approach?

Thanks,

Seth Rowe

Mar 2 '07 #12
On 2 Mar, 18:18, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 12:56 pm, "Marc" <marc_cro...@hotmail.comwrote:


On 2 Mar, 17:49, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 12:37 pm, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 17:13, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 9:14 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:30, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 12:27, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 7:04 am, "Marc" <marc_cro...@hotmail.comwrote:
On 2 Mar, 11:52, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 2, 6:16 am, "Marc" <marc_cro...@hotmail.comwrote:
Hi,
How can i increase the mousehover event timer?
AddHandler NewBtn.MouseHover, AddressOf Shownotes
Private Sub Shownotes(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox("ttt")
Thanks!!!
How about using MouseEnter / MouseLeave instead? If you need a timer,
MouseEnter could start the timer and MouseLeave could stop it. Setting
the timer's interval property will set the "hover" time to anything
you want (as long as it's 1 millisecond or more).
However looking at your code, I wonder if using tooltips or even a
helpprovider might be better. What exactly are you trying to
accomplish?
Thanks,
Seth Rowe
Thanks Seth,
you are right...Tooltips are much better for me.
Im just looking at them now. How do i specify which text to show on a
button in code? i cant find any tooltop options i.e
newbutton.tooltiptext?
The ToolTip component is what's called a provider component. It
actually provides a new property to all the applicable control and the
container (like your form) that you drop it on. With that said, after
adding a TooTip component (called ToolTip1 by default) each control
that can have a tooltip will then have a property called "ToolTip on
ToolTip1" - this is where you should set the text for the tooltip.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK thanks- Hide quoted text -
- Show quoted text -
HI,
I have a set of dynamically created buttons and textbox's. Each button
is linked to a textbox using the accessiblename property. I want to
show a button tool tip containing the text box's text. My code so far
is below although i know this wont work!
any help is greatly appreciated.
Private Sub AddNewDriverToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddNewDriverToolStripMenuItem.Click
Dim NewBtn As New Button()
NewBtn.AccessibleName = CStr(Now)
Me.Controls.Add(NewBtn)
Dim NewTxt As New RichTextBox
NewTxt.AccessibleName = NewBtn.AccessibleName
Me.Controls.Add(NewTxt)
Dim ctlControl As Control
Dim s As String
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is RichTextBox And
ctlControl.AccessibleName = NewBtn.AccessibleName Then
s = NewBtn.Text
End If
Next
ToolTip1.SetToolTip(NewBtn, s)
Well, in your for each loop you are setting the string "s" to the
value of the button's text, not the RichTextBox's text. Also, this
loop is only run when the user clicks the
AddNewDriverToolStripMenuItem, meaning the tooltips won't be updated
real time.
Also you may look at the tag property. With it you can actually set
the value to an object (like say a certain RichTextBox) and then avoid
having to do a for each loop to find a particular control. Besides, a
person using a Accessibility settings will get upset with your
AccessibleNames :-)
Instead, I would suggest you add a new usercontrol to your program. To
this user control add a RichTextBox a Button, and a ToolTip - leave
the default names for now. Next, add an event handler for the
RichTextBox's TextChanged Event :
Private Sub RichTextBox1_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RichTextBox1.TextChanged
ToolTip1.SetToolTip(Me.Button1, RichTextBox1.Text)
End Sub
This will update the ToolTip for the button whenever the text changes
in the RichTextBox. After you get everything laid out in the user
control the way you want it, instead of adding the RichTextBox and
Button to the form, just add the UserControl you just created. This
way everything is neatly self contained (encapsulated) and you don't
need to worry about it in the form it will be added to. Any features
that need to be exposed by the UserControl to the outside should be
wrapped in a property (or by bubbling events if you need to expose an
event), as it is generally a bad idea to expose an entire object.
Any further questions please ask!
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Seth,
quick question....if i use a Tag instead of accessiblename how can
search for a specific control without using loop?
It depends - which control are you trying to find and why do you need
to find it?
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
OK,
so my users can dynamically add buttons to a form...basically i am
trying to allow the users to save text notes to a button. So when the
user double clicks on a button a text box appears.
As multiple buttons can be added i need a way to tie each button to
its text box. When the user creates a button I also create a new text
box automatically. Before i was populating the accessible name
property with the creation date time to tie the two together.
So when a user double clicks the button i was searching through every
control that matches the accessible name to show the appropriate text
box....make sense?

Ok, store the richtextbox you want to access in the Tag property of
it's associated button.

Even better you should use my suggestion of putting the button and
textbox into a user control and adding the user control at runtime
instead of the button and textbox. That way the usercontrol manages
it's controls (the textbox and button) while the form only has to
worry about adding the usercontrols. Is there something you don't
understand about this approach?

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
OK thanks very much for the help

Mar 2 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Natan | last post by:
I was playing with control events and noticed that if try to change the color of a button or text in a MouseHover event, it is slow to respond. It takes about half a second to notice that the mouse...
1
by: Sheriff | last post by:
Receiving a single mouseHover is simple, just move the mouse over my control and wait. However, following this mouse hover event, if I move the mouse around within the control and once again wait,...
1
by: Phenix Smith | last post by:
I am working on the component and would like to change a display when the user stops moving the mouse inside the control. I used the MouseHover and MouseMove to change the status, but the...
2
by: melanieab | last post by:
Hi, How can you determine which cell the mouse is positioned over during the mousehover event? Thanks so much! Mel
1
by: melanieab | last post by:
Hi, I've used the MouseHover event in my datagrid and have almost everything the way I want it - but I've realized that the MouseHover event won't go unless the mouse leaves the datagrid. But I...
3
by: Saurabh | last post by:
I'm a user of Visual Studio Web Developer 2005 Express Edition & I use C# as the language in it. So, the problem i'm facing is that I want to add a MouseHover event to an image but i could'nt find...
3
by: Marc | last post by:
Hi, I create buttons dynamically at runtime in my application. I want to open a messgae box when the user hovers over a button.how can i do this? i need something like the below(which doesnt...
0
by: Marc | last post by:
AddHandler NewBtn.MouseHover, AddressOf Shownotes
3
by: Boki | last post by:
Hi All, I saw the paint.net program, when mouse hover, the color palette become 100% opacity. I try the code below, the issue is I also have some other controls ( textbox/button ) in my form,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.