|
Putting object to an array initializer?
|
|
|
|
|
|
That doesn't work
See following error:
Error 1 Array initializers are valid only for arrays, but the type of 'arratxt' is 'Object'.
|
|
|
|
|
this is for 3 textbox
Dim ObjArray() As Object = {TextBox1, TextBox2, TextBox3}
For i As Integer = 0 To ObjArray.Length - 1
ObjArray(i).text = ""
Next
|
|
|
|
|
This works;
Dim xTextBox As TextBox = Nothing
For Each xObject As Object In Me.Controls
If TypeOf xObject Is TextBox Then
xTextBox = xObject
xTextBox.Text = ""
End If
Next
|
|
|
|
|
He still doesn't clear anything of my textboxes
|
|
|
|
|
Who doesn't?
I chucked some text boxes and a button on the form, the text boxes had random text in them, the code above is in the button click event.
It works for me! Did you try what i posted?
|
|
|
|
|
Yes, i copied into the button click event. But nothing happened
Could it be a problem that my textboxes are also inside a groupbox?
|
|
|
|
|
no problem
no defrence
Dim ob() As Object = {TextBox1, TextBox2}
For i As Integer = 0 To ob.Length - 1
ob(i).text = ""
Next
|
|
|
|
|
Yes, but you didn't state that in you original problem statement!
change it to;
Dim xTextBox As TextBox = Nothing
For Each xObject As Object In Me.GroupBox1.Controls
If TypeOf xObject Is TextBox Then
xTextBox = xObject
xTextBox.Text = ""
End If
Next
|
|
|
|
|
THanks, this worked. I forgot also the "1" after groupbox. Thanks
|
|
|
|
|
|
What you gibbering on about now! Didn't see you fixing his problem! just filling thread with cr@p.
Looks like someone has been uni-voting you this morning, can't understand why.........
|
|
|
|
|
hi every body,
how to display categories by tree view
i am read my data from database (acesss)
my table is :
filds:
CategoryId - Root - CategoryName
1 0 country
2 1 city
3 2 school
4 3 class 102
5 4 Chair
6 5 leg
thank you very match before your ansewer .
please hury up ... help
|
|
|
|
|
miladbiranvand wrote: please hury up
NO !!!!!
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
|
I have a table in the following format and I want to create a form with a tree view control to display the data to the end user.
All the rows with LeafCategory is 0 have children. Leaf category 1 means its last category. i.e not expandable.
In the following example category id 20081 is the Main category. A category is considered main category when the CategoryID and CategoryParentId are same.
CategoryId 's 37903 and 4707 are children of 20081. 37909, 63516, 37911 are childen of 4707... etc.
I don't want to write a sql statmet for each node to find out the childen. I'm looking for a solution with arrays, hash table .. etc. VB.NET
CategoryId CategoryLevel CategoryName CategoryParentId LeafCategory
----------- ------------- -------------------------------------------------- ---------------- ------------
20081 1 Antiques 20081 0
37903 2 Antiquities (Classical, Amer.) 20081 0
4707 2 Architectural & Garden 20081 0
37909 3 Ceiling Tins 4707 1
63516 3 Chandeliers, Fixtures, Sconces 4707 1
37911 3 Hardware 4707 0
37912 4 Door Bells, Knockers 37911 1
37913 4 Hooks & Brackets 37911 1
37914 4 Knobs & Handles 37911 1
|
|
|
|
|
pleass this see
but in vb.net
|
|
|
|
|
Better be quick, your assignment for school must be due on Monday is it?
FAIL
|
|
|
|
|
|
please help!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
If you want help you are going about it the wrong way.
READ THE POSTS AT THE TOP OF THE FORUM - They are easy to understand!
|
|
|
|
|
|
|