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

myform.Controls.Item(i)


Form:
addlist(me)

Module:

Sub addlist(ByVal myform As Form)

Dim myList As New ListBox()

myList = myform.Controls.Item(1)

mylist.items.add("test")

End Sub
I have many listboxes and text boxes and i can find their control index
number to use like myform.control.item(i).
Can u help me?


Nov 20 '05 #1
19 6556
* "Murat Kelleci" <overflow_at_softhome_net> scripsit:
Form:
addlist(me)

Module:

Sub addlist(ByVal myform As Form)

Dim myList As New ListBox()
'As New' doesn't make sense here. Skip the 'New'.
myList = myform.Controls.Item(1)

mylist.items.add("test")

End Sub
I have many listboxes and text boxes and i can find their control index
number to use like myform.control.item(i).


???

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
> I have many listboxes and text boxes and i can find their control index
number to use like myform.control.item(i).
Can u help me?


I don't understand your question, would you please re-phrase it?

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
************************************
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
Nov 20 '05 #3
Dim c As Windows.Forms.Control

For Each c In Me.Controls

If c.GetType.ToString() = "System.Windows.Forms.TextBox" Then

MsgBox(c.Text)

End If

Next

Regards - OHM

Murat Kelleci wrote:
Form:
addlist(me)

Module:

Sub addlist(ByVal myform As Form)

Dim myList As New ListBox()

myList = myform.Controls.Item(1)

mylist.items.add("test")

End Sub
I have many listboxes and text boxes and i can find their control
index number to use like myform.control.item(i).
Can u help me?


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #4
"One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> schrieb
Dim c As Windows.Forms.Control

For Each c In Me.Controls

If c.GetType.ToString() = "System.Windows.Forms.TextBox"
Then
or:
If TypeOf c Is System.Windows.Forms.Textbox Then

MsgBox(c.Text)

End If

Next

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> scripsit:
Dim c As Windows.Forms.Control

For Each c In Me.Controls

If c.GetType.ToString() = "System.Windows.Forms.TextBox" Then
Why not 'If TypeOf c Is TextBox Then'?
MsgBox(c.Text)

End If

Next


--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
I like 2 b different, you dont !

OHM
Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com>
scripsit:
Dim c As Windows.Forms.Control

For Each c In Me.Controls

If c.GetType.ToString() = "System.Windows.Forms.TextBox" Then


Why not 'If TypeOf c Is TextBox Then'?
MsgBox(c.Text)

End If

Next


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #7
"One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> schrieb
I like 2 b different, you dont !


We like types resolved at compile time. ;-)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> scripsit:
I like 2 b different, you dont !


ROFL -- I like to write "elegant" code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
:)

Armin Zingler wrote:
"One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> schrieb
I like 2 b different, you dont !


We like types resolved at compile time. ;-)


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #10
:)

Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com>
scripsit:
I like 2 b different, you dont !


ROFL -- I like to write "elegant" code.


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #11
At least my code works. )=

Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com>
scripsit:
I like 2 b different, you dont !


ROFL -- I like to write "elegant" code.


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #12
* "Armin Zingler" <az*******@freenet.de> scripsit:
I like 2 b different, you dont !


We like types resolved at compile time. ;-)


Who is "we"?

:-)))

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> scripsit:
At least my code works. )=


I didn't doubt that.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #14
I think Armin is referencing a very long thread on Type Casting we were
involved in.

Regards - OHM

Herfried K. Wagner [MVP] wrote:
* "Armin Zingler" <az*******@freenet.de> scripsit:
I like 2 b different, you dont !


We like types resolved at compile time. ;-)


Who is "we"?

:-)))


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #15
It Voz a Joke !

I vill hold up mine hand ( mine only hand ) next time to signal you to laugh
!!

ROTFL
Regards - OHM

Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com>
scripsit:
At least my code works. )=


I didn't doubt that.


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #16
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
* "Armin Zingler" <az*******@freenet.de> scripsit:
I like 2 b different, you dont !


We like types resolved at compile time. ;-)


Who is "we"?

:-)))


You and I, because we gave the same answer.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #17
Cor
I have not seen a pInvoke in this thread so it is not something Herfried
likes
You and I, because we gave the same answer.


(I know the answer from Armin on this)

:-))

Cor
Nov 20 '05 #18
* "One Handed Man [ OHM# ]" <OneHandedMan{at}BTInternet{dot}com> scripsit:
It Voz a Joke !

I vill hold up mine hand ( mine only hand ) next time to signal you to laugh
!!

ROTFL


LOL -- I dodn't interpret the ")=" as a smiley...

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #19
* "Cor" <no*@non.com> scripsit:
I have not seen a pInvoke in this thread so it is not something Herfried
likes


Mhm... Are you sure I like p/invoke?

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #20

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

Similar topics

1
by: Mark Miller | last post by:
I have created a number of RadioButton controls during the OnItemDataBound event of a datagrid control. ..aspx file: <asp:datagrid id="dgProductOptions" runat="server"...
1
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
12
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event....
66
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
2
by: rn5a | last post by:
A DataGrid displays 8 columns - ProductID, ProductName, Description, Price, Quantity, Sub-Total, Edit & Delete. *Edit* is a EditCommandColumn, *Delete* is a ButtonColumn & *Quantity* is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
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,...
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.