Hi
I want to chnage the name of a group box during a procedure call in my code. I tried using groupbox.name="newname" but it made no difference when I stopped debugging. Can anyone help please?
When you stop the program and go back to desing mode the name will be what ever you gave it when you placed it. I know of no way to make it perminant short of designing a new control to do just that. And I have no idea if it could even be done.
What is the end result you are trying to achive. There is probablly another way of acomplishing what you are to code. Give some more detail so we can help
Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb
-----------------------------------
If you can't explain it simply, you don't understand it well enough.
- A. Einstein
I have a form that has 4 group boxes in it with exactly the same contents (a whole lot of text boxes) To the user it seems as though each box is a new subform in which to enter the details of a person into.
I encountered problems when a user wants to delete a gb after filling out the other boxes after it.
the maximum subforms to fill out is four so they fill out each gb in order however i allow them to go back and forward using the next and previous buttons below.
I wanted to, if they deleted a gb that was not the last one, swap the name of the deleted one to that of the last gb so that, while navagating through the 4 gb i could simply make the last one (or however many they deleted) not visible and they would only see the ones that were active and not still press next on a gb that they supposdly deleted.
Well done if u can actually understand my explaination
You cant change the name while the program is running but you can create a new object with a different name that points to the same reference in memory. But first I want to understand what you are doing.
What are you using the GroupBox name for. Are you adding the data into a DB using the Name as a key?
Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb
-----------------------------------
If you can't explain it simply, you don't understand it well enough.
- A. Einstein
Unlike VB6, you CAN change the Name of a form or control while running BUT, the NAME property has no meaning after compilation.
"Control.Name Property
See Also
Control Class | Control Members | System.Windows.Forms Namespace | ISite.Name | Control Members (Visual J# Syntax)
Visual Basic
Gets or sets the name of the control.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.