I am working with a panel of preconfigured textbox controls arranged
in rows and columns. They are programmatically updated based on
changing data from an external data collector device.
I would like to add a textbox_ click event property to one specific
column, of this group, which I intend to use as a trigger to prompt
for additional user supplied information. I don't see a way to do
this in the textbox properties, so is there is some convenient way to
add this property to textbox controls? If so, could you provide a
code snippet example of how to do this?
Thanks,
Ally 5 2829
ally wrote in news:hf********************************@4ax.com: I am working with a panel of preconfigured textbox controls arranged in rows and columns. They are programmatically updated based on changing data from an external data collector device.
I would like to add a textbox_ click event property to one specific column, of this group, which I intend to use as a trigger to prompt for additional user supplied information. I don't see a way to do this in the textbox properties, so is there is some convenient way to add this property to textbox controls? If so, could you provide a code snippet example of how to do this?
Got focus?
--
Cheers, ymt.
Hi, I would like to add a textbox_ click event property to one specific column,...
Events and Properties are two separate things. It might help to
identify what exactly you want to add.
...which I intend to use as a trigger to prompt for additional user supplied information
If I understand you correctly, then your problem can simply be solved
by making a common EventHandler for all the TextBoxes in that column,
and wiring the Click / MouseDown event to this EventHandler. For
instance :
Private Sub MySpecialTextColumnHandler(Byval sender as Object, Byval e
as EventArgs) Handles Text1.Click, Text2.Click, Text3.Click....
' First identify the Textbox that was clicked
Dim txt as TextBox = DirectCast(sender, TextBox)
' Take necessary actions...
:
:
End Sub
If you need to take special actions depending on the MouseButton that
was clicked, then wire up the handler to the MouseDown events instead.
HTH,
Regards,
Cerebrus.
On 9 Apr 2006 08:57:23 -0700, "Cerebrus" <zo*****@sify.com> wrote: Hi,
I would like to add a textbox_ click event property to one specific column,... Events and Properties are two separate things. It might help to identify what exactly you want to add. ...which I intend to use as a trigger to prompt for additional user supplied information
If I understand you correctly, then your problem can simply be solved by making a common EventHandler for all the TextBoxes in that column, and wiring the Click / MouseDown event to this EventHandler. For instance :
Private Sub MySpecialTextColumnHandler(Byval sender as Object, Byval e as EventArgs) Handles Text1.Click, Text2.Click, Text3.Click.... ' First identify the Textbox that was clicked Dim txt as TextBox = DirectCast(sender, TextBox) ' Take necessary actions... : : End Sub
If you need to take special actions depending on the MouseButton that was clicked, then wire up the handler to the MouseDown events instead.
HTH,
Regards,
Cerebrus.
Thanks your for your help! You've provided a way to do what I'm
after, but I don't understand how to identify which textbox triggered
the event.
Using your example, with three textboxes as the underlying controls
for example, how would you go about identifying which one called the
click event?
Ally
<ally> schrieb: I would like to add a textbox_ click event property to one specific column, of this group, which I intend to use as a trigger to prompt for additional user supplied information. I don't see a way to do this in the textbox properties, so is there is some convenient way to add this property to textbox controls? If so, could you provide a code snippet example of how to do this?
You may want to handle the control's 'Enter' or 'GotFocus' event.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Hi,
It depends on what is the distinguishing property of the textboxes. You
could check the Name property or the Tag property (which you have to
set beforehand), for instance. In the sample code I provided above,
before "Take necessary actions", you could run a check in this way :
Select case txt.Tag
Case "Absurd"
' Do something
Case "Wierd"
' Do something
Case "Crazy"
' Do something
End Select
Hope this helps,
Regards,
Cerebrus. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris Mayers |
last post by:
Hi,
I have an application that has (for the sake of argument) 2 (MDI) windows
open.
If I click into a textbox on FormA then the 'Enter' event for that TextBox
fires, great!
However, if I then...
|
by: JayDee |
last post by:
After a user enters data into a field, I need to populate other controls on
the form, based on the user entry. I have to use either Leave, Validating or
Validated, and I take it I can't use...
|
by: Steve S |
last post by:
Heres what I want to do...User types into a texbox, clicks a button, the
button saves that text to a file. The problem is that when I click the
submit button, any changes made to the textbox are...
|
by: George Durzi |
last post by:
I have a text box and a button, and I want the enter key to run the click
event of the button. The textbox and button are inside a user control. I
tried all sorts of stuff with the __EVENTTARGET...
|
by: Nate Hekman |
last post by:
As I've mentioned a couple of times in the last few minutes(!), I've got a
simple form with an edit box and a Submit button. If I type something in
the Edit box and hit Enter I hear a click but...
| |
by: Mark Broadbent |
last post by:
This one has got me absolutely stumped.
At work I have created a simple web form that gets data from a sql backend
and puts this to a dataset.
I have an edit button that when clicked will set...
|
by: Joe |
last post by:
Hello All,
I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton
(SearchButton) server controls. The user can type search text in
SearchTextBox and click SearchButton and...
|
by: Mike |
last post by:
Is there a way to determine if a user deleted text in a asp:textbox?
I have a textbox were users can enter in a product number, then they click a button to see if the product numbers(s) exists in...
|
by: daonho |
last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
|
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,...
|
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...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |