473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

The variable 'GroupBox1' is either undeclared or was never assigned.

I created a Child Form and added several controls. One of the 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.

Kindly let me know how to fix it.

Many thanks in advance

Feb 26 '06 #1
6 6248
<ns********@gmail.com> schrieb
I created a Child Form and added several controls. One of the
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.
A shared groupbox does not make sense. Where is the Groupbox if you don't
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
Feb 26 '06 #2
> "Public Shared WithEvents GroupBox3 As System.Windows.Forms.GroupBox"
Note down "Shared" added....


Now, why in the world would you want a "shared" GroupBox !!?

Shared elements are not associated with a specific instance of a class
or structure.

Regards,

Cerebrus.

Feb 26 '06 #3
I just want create a NewClass where I want to validate the members of
groupbox1 of Form2 ...

Thanks

Feb 26 '06 #4
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.

Feb 27 '06 #5
Many thanks Cerebrus. It sounds good idea.

Feb 27 '06 #6
Most welcome, buddy ! ;-)

Happy coding,

Regards,

Cerebrus.

Feb 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chris Beall | last post by:
If you want your code to be bulletproof, do you have to explicitly check for the existence of any possibly-undefined variable? Example: window.outerHeight is defined by some browsers, but not...
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
2
by: ~~~ .NET Ed ~~~ | last post by:
It is not the first time I see this happen. I am using VS.NET 2003 with .NET Framework 1.1. In this particular situation I have a custom user control in a windows form. There is a member variable...
0
by: Michael Howes | last post by:
I have a strange "warning" that shows up during design time in my current project. I have a UserControl, which contains a public enum called ViewTypes This UserControl also has a public property...
2
by: hui | last post by:
Here is a problem I am having with web form designer. I have a database control in the form, and setup the connection string as a dynamic property. It compiles and runs fine. I close the aspx...
0
by: VB Programmer | last post by:
I wanted to access some properties of a panel control that is on a different form. So, I went to the (Declarations) section of my main form (the form with the panel) and changed the panel (called...
4
by: mros | last post by:
I've created three buttons on a form (IsMdiContainer=True), it's mdi parent. I need to disable these buttons from one of my child form. So, I've changed these buttons modifier to Friend Shared...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
11
by: =?UTF-8?Q?Filip_Gruszczy=C5=84ski?= | last post by:
Hello everyone! It is my first message on this list, therefore I would like to say hello to everyone. I am fourth year student of CS on the Univeristy of Warsaw and recently I have become very...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.