473,387 Members | 1,510 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,387 software developers and data experts.

Events Windows form

Hello
Lets Say Im in a Text Box
User Clicks on a Button
If i have Textbox_leave() event

How Can i know if the User Has Clicked the Button (cancel button)

example
TextBox_leave Fires then button_enter then button_click

Whilst im in the TextBox Leave i need some way of finding out if the Button
Was Clicked

Thanks DaveL
Oct 7 '08 #1
2 1329
"DaveL" <dv*****@sbcglobal.netwrote in message
news:ah**************@nlpi070.nbdc.sbc.com...
Lets Say Im in a Text Box
User Clicks on a Button
If i have Textbox_leave() event

How Can i know if the User Has Clicked the Button (cancel button)

example
TextBox_leave Fires then button_enter then button_click

Whilst im in the TextBox Leave i need some way of finding out if the
Button Was Clicked
At the time of the TextBox_Leave, the user has NOT clicked the button.
When the mouse button is depressed over the Button control, you are leaving
the textbox, so the texbox_leave event fires. If at this point you release
the mouse button, a Button_Click happens. But you could also move the mouse
outside of the Button and then release the mouse button, so a Button_Click
would not happen. So at the time of the textbox_leave you can't yet know
whether a button_click is going to happen later or not (both outcomes are
possible).
Another way to see this if if you don't use the mouse: you could press
TAB to move from the textbox to the button and then press spacebar to
produce a button_click... or continue tabbing and move elsewhere without
doing a button_click (but having done a textbox_leave).

Oct 7 '08 #2
Thank you very much....
DaveL

"Alberto Poblacion" <ea******************************@poblacion.orgwro te
in message news:%2***************@TK2MSFTNGP03.phx.gbl...
"DaveL" <dv*****@sbcglobal.netwrote in message
news:ah**************@nlpi070.nbdc.sbc.com...
>Lets Say Im in a Text Box
User Clicks on a Button
If i have Textbox_leave() event

How Can i know if the User Has Clicked the Button (cancel button)

example
TextBox_leave Fires then button_enter then button_click

Whilst im in the TextBox Leave i need some way of finding out if the
Button Was Clicked

At the time of the TextBox_Leave, the user has NOT clicked the button.
When the mouse button is depressed over the Button control, you are
leaving the textbox, so the texbox_leave event fires. If at this point you
release the mouse button, a Button_Click happens. But you could also move
the mouse outside of the Button and then release the mouse button, so a
Button_Click would not happen. So at the time of the textbox_leave you
can't yet know whether a button_click is going to happen later or not
(both outcomes are possible).
Another way to see this if if you don't use the mouse: you could press
TAB to move from the textbox to the button and then press spacebar to
produce a button_click... or continue tabbing and move elsewhere without
doing a button_click (but having done a textbox_leave).

Oct 7 '08 #3

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

Similar topics

10
by: Drakier Dominaeus | last post by:
This is my first time posting here, so please forgive me if I do anything incorrectly. I've been learning C# and working with different things and decided I wanted to get into Multi-Threading....
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
3
by: Crucifix | last post by:
Hello, I'm writing a small C# app, and part of what I'm trying to do involves the dragging of PictureBox controls on a form. Unfortunately, MouseMove seems to be behaving very oddly, causing...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
10
by: Dennis | last post by:
I have a simple form with one button and one text box. In the Form, I create an array list to track the events by adding a descriptive string item to the arraylist in each event. I first Click on...
1
by: Apu Nahasapeemapetilon | last post by:
Hello and thank you in advance for your help. Can anyone think of a reason why this code would work properly on one PC, but not another? I've got a System.Windows.Forms.UserControl that...
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.