Click here to Skip to main content
16,020,628 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionTextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 6:19
Andraw Tang17-Aug-10 6:19 
AnswerRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
riced17-Aug-10 7:23
riced17-Aug-10 7:23 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 8:12
Andraw Tang17-Aug-10 8:12 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 9:00
professionalEddy Vluggen17-Aug-10 9:00 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 8:26
Andraw Tang17-Aug-10 8:26 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 9:02
professionalEddy Vluggen17-Aug-10 9:02 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 9:17
Andraw Tang17-Aug-10 9:17 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 9:38
professionalEddy Vluggen17-Aug-10 9:38 
Using code only;
VB.NET
Public Partial Class Form1
	Inherits Form
	Public Sub New()
		InitializeComponent()

		' Create a button
		Dim b As New Button()
		b.Parent = Me
		b.Location = New Point(0, 0)
		Controls.Add(b)

		' Create a checkbox
		Dim c As New CheckBox()
		c.Parent = Me
		c.Location = New Point(0, 0 + b.Height)
		Controls.Add(c)

		' Hook up both to the same handler
		AddHandler b.Click, New EventHandler(AddressOf MyDragEventHandler)
		AddHandler c.Click, New EventHandler(AddressOf MyDragEventHandler)
	End Sub

	' You can use the sender-object to identify which control raised the event,
	' if required.
	Private Sub MyDragEventHandler(sender As Object, e As EventArgs)
		System.Diagnostics.Debug.WriteLine(sender.ToString() & " iz clicked")
	End Sub
End Class


Or, if you want to do it from the IDE, try these steps;

  • Drag a button and a checkbox to the form
  • Go to the properties of the button, and switch to "events" view (button looks like lightning)
  • Double-click on the Click event, and write your code
  • Go back to the designer, and select the checkbox
  • Properties, events-view; there's a combobox next to the Click event - open it, and select the item "Button1Click"


That should do it Smile | :)
I are Troll Suspicious | :suss:

GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 9:55
Andraw Tang17-Aug-10 9:55 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 10:20
professionalEddy Vluggen17-Aug-10 10:20 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 10:29
Andraw Tang17-Aug-10 10:29 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 11:00
professionalEddy Vluggen17-Aug-10 11:00 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang17-Aug-10 11:15
Andraw Tang17-Aug-10 11:15 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Eddy Vluggen17-Aug-10 11:47
professionalEddy Vluggen17-Aug-10 11:47 
AnswerRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
nikhilhegde00717-Aug-10 21:40
nikhilhegde00717-Aug-10 21:40 
GeneralRe: TextBox_Leave event only fired when move mouse to other control in vb.net 2005 Pin
Andraw Tang18-Aug-10 4:27
Andraw Tang18-Aug-10 4:27 
QuestionFile.Delete Method Pin
98fireblade17-Aug-10 5:08
98fireblade17-Aug-10 5:08 
AnswerRe: File.Delete Method Pin
David Mujica17-Aug-10 5:22
David Mujica17-Aug-10 5:22 
GeneralRe: File.Delete Method Pin
98fireblade17-Aug-10 5:29
98fireblade17-Aug-10 5:29 
AnswerRe: File.Delete Method Pin
dan!sh 17-Aug-10 5:39
professional dan!sh 17-Aug-10 5:39 
GeneralRe: File.Delete Method Pin
98fireblade17-Aug-10 5:42
98fireblade17-Aug-10 5:42 
AnswerRe: File.Delete Method Pin
Luc Pattyn17-Aug-10 5:52
sitebuilderLuc Pattyn17-Aug-10 5:52 
GeneralRe: File.Delete Method Pin
98fireblade17-Aug-10 6:34
98fireblade17-Aug-10 6:34 
GeneralRe: File.Delete Method Pin
Eddy Vluggen17-Aug-10 8:55
professionalEddy Vluggen17-Aug-10 8:55 
AnswerRe: File.Delete Method Pin
Dave Kreskowiak17-Aug-10 6:22
mveDave Kreskowiak17-Aug-10 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.