sequence text boxes name
-
i am trying to change the name of text boxes in vb.net as they are not in proper sequence 180 of them but it wont let me change name as invalid property textbox21 needs to be textbox40 and textbox40 needs to be textbox21 and so on any ideas
If I understand your question correctly, you are trying to change the name of a textbox to a name already in use. If that is the case, change your naming convention: instead of naming them 'textbox1' through 'textbox180', use something like 'txtbox1' through 'txtbox180'. Since these objects should not already exist, you won't have a problem. Tim
-
i am trying to change the name of text boxes in vb.net as they are not in proper sequence 180 of them but it wont let me change name as invalid property textbox21 needs to be textbox40 and textbox40 needs to be textbox21 and so on any ideas
kendo17 wrote:
180 of them
Well, your basic problem is that your UI sucks. Use a grid if you want a grid. Don't use 180 text boxes if they don't represent a grid. The other problem is that your naming convention sucks, and that if you want to set the names of your controls, you should do it in the designer, or if you're dynamically creating them, you should put them where you want them in the first place.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
i am trying to change the name of text boxes in vb.net as they are not in proper sequence 180 of them but it wont let me change name as invalid property textbox21 needs to be textbox40 and textbox40 needs to be textbox21 and so on any ideas
I would bet you would be better off doing something like using an image of the seating chart as the background of the Form and handling the click event of the form. Get the mouse corrodinates to deterime which seat was clicked. You would have to do some math so you know how big the x and y range is for each seat but I bet you could figure if each seat is 10 X 10 points, for example, and your mouse click was at x y you could find which seat was clicked. I have never done this but that would be the first thing I look at.