|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
The variable 'GroupBox1' is either undeclared or was never assigned.is GroupBox1. When I want to change the access modifier property of the GroupBox1 FROM "Public WithEvents GroupBox3 As System.Windows.Forms.GroupBox" TO "Public Shared WithEvents GroupBox3 As System.Windows.Forms.GroupBox" Note down "Shared" added.... When i am executing, it did not produce any error. When I go back to design window, it produced following error D:\DOTNET\vbnet\Part2\Form2.vb(621): The variable 'GroupBox1' is either undeclared or was never assigned. I donot understand this error. Kindly let me know how to fix it. Many thanks in advance <nsikkan***@gmail.com> schrieb
Show quoteHide quote > I created a Child Form and added several controls. One of the A shared groupbox does not make sense. Where is the Groupbox if you don't > control is GroupBox1. When I want to change the access modifier > property of the GroupBox1 > > FROM > > "Public WithEvents GroupBox3 As System.Windows.Forms.GroupBox" > > TO > > "Public Shared WithEvents GroupBox3 As > System.Windows.Forms.GroupBox" > > Note down "Shared" added.... > > When i am executing, it did not produce any error. > > When I go back to design window, it produced following error > > D:\DOTNET\vbnet\Part2\Form2.vb(621): The variable 'GroupBox1' is > either undeclared or was never assigned. > > > I donot understand this error. have a Form? Where is it if you have multiple Forms? In addition, you must not modify the code generated by the Form designer. > Kindly let me know how to fix it. Remove the Shared keyword.Armin > "Public Shared WithEvents GroupBox3 As System.Windows.Forms.GroupBox" Now, why in the world would you want a "shared" GroupBox !!?> Note down "Shared" added.... Shared elements are not associated with a specific instance of a class or structure. Regards, Cerebrus. I just want create a NewClass where I want to validate the members of
groupbox1 of Form2 ... Thanks Hi nsikkander,
What are the "members" of your GroupBox ? Controls, I presume. And your Controls must have associated values (Text etc.) that you want to validate. Well, in that case, why not store the values in some sort of collection (Maybe... Arraylist ?) and then pass that collection to a method/function in your NewClass, which can then return a Boolean True or False depending on the Validation result. In any case, a GroupBox cannot be Shared. Inherited maybe, but not Shared. Regards, Cerebrus.
How does the community rate .NET 2005 vs. .NET 2003?
Some thoughts on VB9 Set a text in a RowHeader cell How to move a menu item to the left?! List all public properties of a Class ? academic version [2003] at run time database connection Moving a project to a different location Using 'Function Keys' In vb.net Newbie... |
|||||||||||||||||||||||