I have the following code:
Dim myTextBox(10) As TextBox
Dim x As Integer
For x = 0 To 9
myTextBox(x) = New TextBox
With myTextBox(x)
Select Case x 8 914
Hi vbMark,
I dont see the events OnFocus or Onchange for a textbox.
But in general you create an addhandler for the events you'll need.
Hope this helps
"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4... I have the following code:
Dim myTextBox(10) As TextBox
Dim x As Integer For x = 0 To 9
myTextBox(x) = New TextBox With myTextBox(x) Select Case x . . some code . End Select End With
Me.Controls.Add(myTextBox(x))
Next
Now how do I get the OnFocus or OnChange events for myTextBox?
Thanks!
Sorry, I meant GotFocus and TextChanged.
"Pipo" <Pi**@nobody.com> wrote in news:OkBwTPK$EHA.3988
@TK2MSFTNGP11.phx.gbl: Hi vbMark,
I dont see the events OnFocus or Onchange for a textbox. But in general you create an addhandler for the events you'll need.
Hope this helps
"vbMark" <no@email.com> wrote in message news:Xn************************@130.133.1.4... I have the following code:
Dim myTextBox(10) As TextBox
Dim x As Integer For x = 0 To 9
myTextBox(x) = New TextBox With myTextBox(x) Select Case x . . some code . End Select End With
Me.Controls.Add(myTextBox(x))
Next
Now how do I get the OnFocus or OnChange events for myTextBox?
Thanks!
Hi vbMark,
Did you looked at addhandler?
Is your problem solved?
Greets,
"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4... Sorry, I meant GotFocus and TextChanged.
"Pipo" <Pi**@nobody.com> wrote in news:OkBwTPK$EHA.3988 @TK2MSFTNGP11.phx.gbl:
Hi vbMark,
I dont see the events OnFocus or Onchange for a textbox. But in general you create an addhandler for the events you'll need.
Hope this helps
"vbMark" <no@email.com> wrote in message news:Xn************************@130.133.1.4... I have the following code:
Dim myTextBox(10) As TextBox
Dim x As Integer For x = 0 To 9
myTextBox(x) = New TextBox With myTextBox(x) Select Case x . . some code . End Select End With
Me.Controls.Add(myTextBox(x))
Next
Now how do I get the OnFocus or OnChange events for myTextBox?
Thanks!
vbMark
\\\
For Each ctr as TextBox In myTextBox
AddHandler ctr.GotFocus, AddressOf meGotFocus
AddHandler ctr.TextChanged, AddressOf meTextChanged
Next
///
I hope this helps?
Cor
I think addhandler may be what I'm looking for. First tests look good.
I'll contine trying it out.
Thanks!
"Pipo" <Pi**@nobody.com> wrote in news:ODc12ZK$EHA.1084
@tk2msftngp13.phx.gbl: Hi vbMark,
Did you looked at addhandler? Is your problem solved?
Greets,
"vbMark" <no@email.com> wrote in message news:Xn************************@130.133.1.4... Sorry, I meant GotFocus and TextChanged.
"Pipo" <Pi**@nobody.com> wrote in news:OkBwTPK$EHA.3988 @TK2MSFTNGP11.phx.gbl:
> Hi vbMark, > > I dont see the events OnFocus or Onchange for a textbox. > But in general you create an addhandler for the events you'll need. > > Hope this helps > > > "vbMark" <no@email.com> wrote in message > news:Xn************************@130.133.1.4... >> I have the following code: >> >> Dim myTextBox(10) As TextBox >> >> Dim x As Integer >> For x = 0 To 9 >> >> myTextBox(x) = New TextBox >> With myTextBox(x) >> Select Case x >> . >> . some code >> . >> End Select >> End With >> >> Me.Controls.Add(myTextBox(x)) >> >> Next >> >> Now how do I get the OnFocus or OnChange events for myTextBox? >> >> Thanks! > > >
"Cor Ligthert" <no************@planet.nl> wrote in news:#WKBRfK$EHA.3820
@TK2MSFTNGP11.phx.gbl: vbMark
\\\ For Each ctr as TextBox In myTextBox AddHandler ctr.GotFocus, AddressOf meGotFocus AddHandler ctr.TextChanged, AddressOf meTextChanged Next ///
I hope this helps?
Cor
Ok, using AddHandler works and creates the event. Now how do I know which
control in the array fired the event?
I have this in my loop:
AddHandler myTextBox(x).GotFocus, AddressOf myTextBox_GotFocus
And this Sub:
Sub myTextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs)
????
End Sub
Thanks.
vbMark,
In this situation I gave every control a name before I add them to the form.
\\\
myTextBox.Name=x.ToString
Me.Controls.Add(myTextBox(x))
///
Then you can do by instance in the event
\\\
Sub myTextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs)
Select Case DirectCast(sender,TextBox).Name
Case "0"
'do something
Case "1"
End Sub
///
I hope this helps?
Cor
Excellent! Thanks!
"Cor Ligthert" <no************@planet.nl> wrote in
news:#z**************@TK2MSFTNGP11.phx.gbl: vbMark,
In this situation I gave every control a name before I add them to the form.
\\\ myTextBox.Name=x.ToString Me.Controls.Add(myTextBox(x)) ///
Then you can do by instance in the event
\\\ Sub myTextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Select Case DirectCast(sender,TextBox).Name Case "0" 'do something Case "1" End Sub ///
I hope this helps?
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Chuck Ritzke |
last post by:
Hi,
I've searched the newsgroup and other sources to understand how to handle
runtime controls and see I'm not the only one who's confused, but I'm still
not quite sure of the best way to handle...
|
by: Eric Sabine |
last post by:
This app will fill a datatable from sql server at load time (and can clear
and reload it again if the user requests it). The contents of the data table
contain program names and program groups. For...
|
by: samean |
last post by:
Hello,
Could you explain me,In VB6 using control array,and how
about VB.net.
Thanks
|
by: Tym |
last post by:
I have a piece of code thus:
For iLOOP = 0 To iNoDays - 1
For jLOOP = 0 To iMaxPeriods - 1
iX = 10 + (iLOOP * (dCellWidth + 10))
iY = 10 + (jLOOP * (dCellHeight + 10)) +
Me.Size.Height / 4
If...
|
by: Mian Mahboob |
last post by:
hi
At Runtime i add a Form in designing time panel Control. on that form i add
couple of user controls.
i want to comuncated each of usercontrol's on my Form which is execute on
Runtime...
|
by: Mian Mahboob |
last post by:
Nicholas Paldino
in my application a have an Windows form on that i place an Panel Control.
in Form
load event i ganerate an Form in Panel Control on Runtime then get an design
time
create...
|
by: Steve Moreno |
last post by:
Hi all,
I've got a web form that I've written code to create an array of
DropDownList controls on the page depending on how many records are pulled
back. The code to create the controls is...
|
by: Klaus Jensen |
last post by:
Subject: Handling events of controls created at runtime
I need to render some buttons at runtime based on a database, tie events to
them, and handle the events when they fire.
In Page_Load I...
|
by: rn5a |
last post by:
The different Page events in the page life cycle like Page_PreInit,
Page_Init, Page_Load etc. - are they different stages of the runtime
process?
Does a server send back the HTML output of an...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: 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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |