|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
control arrayHi,
I am still using vb6. The project is too big to just copy and paste it to VB.NET. I think I need to rewrite everything. One question is: If there is no control array, is it better to just create the bunch of button objects from one button control rather than just drag and drop a bunch of buttons on the screen? It doesn't matter. The only benefit to creating one button
control and copying and pasting it multiple times is that all of them will be the same size. But you can get the same thing by selecting all of them and using the menu options to make them the same size. The question is why are they in a control array; what are you doing with them? You can add them to a generic list and access them that way, or you can cycle through all the controls looking for them, and identify them by the fact that they are buttons, or by the value you place in the Tag field. If you need to know how to do that, re-post and I (or someone else) will post the code for that. Good luck. Robin S. -------------------------------------- Show quoteHide quote "bz" <nospam@yahoo.com> wrote in message news:Own5X1wHHHA.3952@TK2MSFTNGP02.phx.gbl... > Hi, > > I am still using vb6. The project is too big to just copy and paste > it to VB.NET. I think I need to rewrite everything. > One question is: > > If there is no control array, is it better to just create the bunch of > button objects from one button control rather than just drag and drop > a bunch of buttons on the screen? > > >
Show quote
Hide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in Hi again Robin,news:3MydnR7nhOUPCR3YnZ2dnUVZ_tadnZ2d@comcast.com: > It doesn't matter. The only benefit to creating one button > control and copying and pasting it multiple times is that > all of them will be the same size. But you can get the same > thing by selecting all of them and using the menu options > to make them the same size. > > The question is why are they in a control array; what are you > doing with them? > > You can add them to a generic list and access them that way, > or you can cycle through all the controls looking for them, > and identify them by the fact that they are buttons, or by > the value you place in the Tag field. If you need to know how > to do that, re-post and I (or someone else) will post the > code for that. > > Good luck. > Robin S. I was under the impression that dotnet controls didn't have tag properties... Martin > I was under the impression that dotnet controls didn't have tag At least in the .Net 2.0 controls have the tag property. If they don't> properties... then the project I used them in today is in bad shape :-) Thanks, Seth Rowe Martin Milan wrote: Show quoteHide quote > "RobinS" <RobinS@NoSpam.yah.none> wrote in > news:3MydnR7nhOUPCR3YnZ2dnUVZ_tadnZ2d@comcast.com: > > > It doesn't matter. The only benefit to creating one button > > control and copying and pasting it multiple times is that > > all of them will be the same size. But you can get the same > > thing by selecting all of them and using the menu options > > to make them the same size. > > > > The question is why are they in a control array; what are you > > doing with them? > > > > You can add them to a generic list and access them that way, > > or you can cycle through all the controls looking for them, > > and identify them by the fact that they are buttons, or by > > the value you place in the Tag field. If you need to know how > > to do that, re-post and I (or someone else) will post the > > code for that. > > > > Good luck. > > Robin S. > > Hi again Robin, > > I was under the impression that dotnet controls didn't have tag > properties... > > Martin
Show quote
Hide quote
"Martin Milan" <I***@m.i.do> wrote in message As noted by Seth, they *do* have the property [Tag]. Andnews:Xns989AF8646566I8spmido@194.117.143.38... > "RobinS" <RobinS@NoSpam.yah.none> wrote in > news:3MydnR7nhOUPCR3YnZ2dnUVZ_tadnZ2d@comcast.com: > >> It doesn't matter. The only benefit to creating one button >> control and copying and pasting it multiple times is that >> all of them will be the same size. But you can get the same >> thing by selecting all of them and using the menu options >> to make them the same size. >> >> The question is why are they in a control array; what are you >> doing with them? >> >> You can add them to a generic list and access them that way, >> or you can cycle through all the controls looking for them, >> and identify them by the fact that they are buttons, or by >> the value you place in the Tag field. If you need to know how >> to do that, re-post and I (or someone else) will post the >> code for that. >> >> Good luck. >> Robin S. > > Hi again Robin, > > I was under the impression that dotnet controls didn't have tag > properties... > > Martin thank goodness they didn't get rid of *that*! Robin S. "RobinS" <RobinS@NoSpam.yah.none> wrote in Was it supported in 1.0 and 1.1?news:BKGdne5A9ei-pR_YnZ2dnUVZ_h63nZ2d@comcast.com: > As noted by Seth, they *do* have the property [Tag]. And > thank goodness they didn't get rid of *that*! > > Robin S. The reason I thought it had gone is that once again I've been reading a VB6 to dotnet conversion text (and old one though) which said they had gone. Our VB6 project makes plenty of use of tag as well... Martin Yes. Tag has been a property of the System.Windows.Forms.Control since .NET
Framework 1.0. This means that any class derived from System.Windows.Forms.Control automatically has it. However, a class derived from System.Windows.Forms.Control may override the Tag property of the base class and implement it in a different way, e.g.: Public Overrides Property Tag() As Object Get Throw New Exception("Not implemented.") End Get Set(value As Object) Throw New Exception("Not implemented.") End Set End Property Why anyone would want to do so escapes me, but it is possible. There are a multitude of classes on the Framework that, of course, are not derived from System.Windows.Forms.Control, and any of those may or may not expose a Tag property depending on who wrote the class, how they were feeling at the time and whether or not the month had a 'y' in it, etc. Show quoteHide quote "Martin Milan" <I***@m.i.do> wrote in message news:Xns989A510B12E0EI8spmido@194.117.143.37... > "RobinS" <RobinS@NoSpam.yah.none> wrote in > news:BKGdne5A9ei-pR_YnZ2dnUVZ_h63nZ2d@comcast.com: > >> As noted by Seth, they *do* have the property [Tag]. And >> thank goodness they didn't get rid of *that*! >> >> Robin S. > > Was it supported in 1.0 and 1.1? > > The reason I thought it had gone is that once again I've been reading a > VB6 to dotnet conversion text (and old one though) which said they had > gone. Our VB6 project makes plenty of use of tag as well... > > Martin
Updating database in a loop
System.Threading.Timer does not tick Q: DataColumn Expressions There is already an open DataReader associated with this Connection which must be closed first What is WebBrowser control called now? The below snippet does not work...anyone know how to reference a procedure? Looping through all Tables in a Database Form1.closing in VB2005??? Datagrid problem Getting an Object Properties value... |
|||||||||||||||||||||||