|
-
Oct 30th, 2003, 03:56 AM
#1
No Control Arrays in VB.NET
There are no control arrays in VB.NET !
Why? I miss it
-
Oct 30th, 2003, 04:11 AM
#2
We had a vote and the tribe has spoken.
Actually this is a common worry when moving from VB6 but don't worry .NET has the Add/RemoveHandler methods or Handles keyword which are far better than control arrays. You can grab events from multiple object even if they aren't the same type of control/object now with them. You can also catch events dynamically for new objects like in a control array. It just takes some getting used to thats all.
-
Oct 30th, 2003, 04:12 AM
#3
you can create " virtual " control arrays, by adding handlers to deal with them , eg: if you had 5 buttons , you could make them all handled by one sub and asign them with unique tag values, then in that sub when one of the buttons is pressed, use the tag property in the same way as the index property of vb6.
edit : omg beaten to the post again, must be all the lack of sleep slowing me down
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 30th, 2003, 04:55 AM
#4
I see.
Another question:
I am getting a date value as :
Now, when I do a
VB Code:
dtdateofbirth = CDate(strdob)
I am getting the date along with a time value there. I want to get rid of this time value, but I want to retain the Date type of the variable dtdateofbirth.
Any ideas?
-
Oct 30th, 2003, 09:13 AM
#5
yay gay
try working with the System.DateTime struct
\m/  \m/
-
Oct 30th, 2003, 10:54 AM
#6
All dates are actually a date time set by default you can just show it as a date to get what you want. There are various ToShortDateString, ToLongDateString, ToThisOrThatString... methods to format it or you can use your own simliar to VB6's Format Function.
VB Code:
Dim curDate As Date=Date.Now
Msgbox(curDate.ToShortDateString)
-
Oct 30th, 2003, 02:19 PM
#7
Banned
Dim nowdat As Date=Date.Now
Messagebox(nowdate.ToShortDateString)
-
Oct 30th, 2003, 02:25 PM
#8
didnt Edneeis post the same idea earlier today as the last one? 
edit:
ps: you need .Show when using " Messagebox " , eg: Messagebox.Show(" stuff to show ")
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 30th, 2003, 04:13 PM
#9
I'm guilty of still using Msgbox instead of the more proper MessageBox, but I love MsgBox.
My name is Ed Marquez and I'm a MsgBox-aholic.
-
Oct 30th, 2003, 11:27 PM
#10
Originally posted by Edneeis
I'm guilty of still using Msgbox instead of the more proper MessageBox, but I love MsgBox.
My name is Ed Marquez and I'm a MsgBox-aholic.
Me too. I can't let go of MsgBox.
Anyways, the .ToShortDateString method converts it into a string with the format I want. I guess that any and all date variables will always hold a time value in it as well, and I'll have to convert them to string whenever I want to display them, JA.
-
Oct 31st, 2003, 08:18 AM
#11
Counselling is available to MsgBoxaholics. Contact your local YMCA (Young Messagebox Coder's Association).
Its fun to stay there and you can do anything, apparently.
I don't live here any more.
-
Nov 2nd, 2003, 10:59 AM
#12
Lively Member
Good to see that i'm not the only one hooked on Msgbox. Its tough trying to switch over.
Jason
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
|