|
-
Sep 14th, 2009, 12:41 AM
#1
Thread Starter
New Member
-
Sep 14th, 2009, 12:54 AM
#2
Re: Array of textboxes
You get a changed event, with the index of the changed textbox
-
Sep 14th, 2009, 02:25 AM
#3
Thread Starter
New Member
Re: Array of textboxes
can you please be a little more specific?
-
Sep 14th, 2009, 02:37 AM
#4
New Member
Re: Array of textboxes
I have created one form with an array of text box controls. It means for each text box the name is same. In my example it is txtName. Index property of each control is set to 0,1,2, and 3 (since I have only 4 such controls).
Following event will be fired whenever there is a change in any of the text box. You can know the index of textbox by Index parameter.
Private Sub txtName_Change(Index As Integer)
MsgBox "Text in " & Index & " is changed"
End Sub
Is it ok?
All the best
-
Sep 14th, 2009, 02:47 AM
#5
Thread Starter
New Member
Re: Array of textboxes
It doesnt't work.
Let me be more specific:
Dim txt_array() as textbox
'get n= number of textboxes
redim txt_array (1 to n)
for 1 to n
Set Txt_array(n) = Frm_form.Controls.Add("VB.TextBox", "Txt" & n, Frm_Calcul_Retea)
next n
now i need the event triggered on the change of any of the textboxes....
thank you
-
Sep 14th, 2009, 03:37 AM
#6
Re: Array of textboxes
I don't have vb6 here so I am doing this from memory... Please amend syntax error if any...
vb Code:
Private Sub Txt_array_Change(Index As Integer) Select Case Index '~~> change was made in Txt_array(0) Index = 0 '~~> change was made in Txt_array(1) Index = 1 '~~> change was made in Txt_array(2) Index = 2 '~> And so on End Select End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Sep 14th, 2009, 03:58 AM
#7
Thread Starter
New Member
Re: Array of textboxes
on Private Sub Txt_array_Change(Index As Integer)
i get an "ambigous name detected:Txt_array_Change" compile error
-
Sep 14th, 2009, 04:00 AM
#8
Re: Array of textboxes
that's probably because
Private Sub Txt_array_Change(Index As Integer)
exists somewhere in your code... you must have copy and pasted the code from here into your code window...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Sep 14th, 2009, 04:28 AM
#9
Thread Starter
New Member
Re: Array of textboxes
finnaly figured out
What I had wasn't an array of textboxes, was an array of variables of type textbox , whitch don't have an 'index' proprety (is empty).
Ok...now it's time to learn to use them 
Thank you very much for your help.
-
Sep 14th, 2009, 04:32 AM
#10
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|