C
californiadan
Guest
Hey,
I was wondering how to Increment a Control's Name when pasting?
For example, I have a Form with a TabControl with 20 Tabs, and each tab has the exact same 33 Controls (Labels, TextBoxes, ComboBoxes, CheckBoxes, etc.)
Each control has a name that ends in "_Tab01" since it was created in TabPage1. For example I have a CheckBox Control Named: "chkAutoFill_Tab01"
If I copy my chkAutoFill_Tab01 Control, go to TabPage2 and paste it, the Control's Name gets changed to "CheckBox1". I would like it to Increment the Name of the Control so that when I paste it into a new tab it changes the Name to "chkAutoFill_Tab02" (and then "chkAutoFill_Tab03" the next time I paste it, and so on...)
Is this possible in Visual Basic?
I don't want to have to rename 33 Controls 20 times since that is very time consuming and certain Controls have different codes for each of them when they are Changed or Clicked.
I am using Visual Basic for Visual Studio 2019 and this is a Windows Forms App (.Net Framework)
Thanks and sorry if this has been asked before,
-dan
Continue reading...
I was wondering how to Increment a Control's Name when pasting?
For example, I have a Form with a TabControl with 20 Tabs, and each tab has the exact same 33 Controls (Labels, TextBoxes, ComboBoxes, CheckBoxes, etc.)
Each control has a name that ends in "_Tab01" since it was created in TabPage1. For example I have a CheckBox Control Named: "chkAutoFill_Tab01"
If I copy my chkAutoFill_Tab01 Control, go to TabPage2 and paste it, the Control's Name gets changed to "CheckBox1". I would like it to Increment the Name of the Control so that when I paste it into a new tab it changes the Name to "chkAutoFill_Tab02" (and then "chkAutoFill_Tab03" the next time I paste it, and so on...)
Is this possible in Visual Basic?
I don't want to have to rename 33 Controls 20 times since that is very time consuming and certain Controls have different codes for each of them when they are Changed or Clicked.
I am using Visual Basic for Visual Studio 2019 and this is a Windows Forms App (.Net Framework)
Thanks and sorry if this has been asked before,
-dan
Continue reading...