473,395 Members | 1,774 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,395 software developers and data experts.

3 Simple Questions

Question #1:

I've two forms (Parent = Form1, Child = Form2). How do I find the status of a
control (say RadioButton) on Form1, while I'm doing something on Form2.

VB6 use to allow you to do ==>
If Form1.rbMyButton.Checked = True then blahblahblah

How do I do this in VB.net?
Question #2:
If I have a HIDE button for my Parent Form1 (using ContexMenu and NotifyIcon),
how can I tell the "show" status of my Child Form2 so I can close it when I
hide my Parent?
Question #3:
I've seen examples where the word "NEW" is used in defining something. An
example is:

Me.bttnScan = New System.Windows.Forms.Button()
===

When and why do you 'need' to use the word "New"? I'm kinda curious.

Answers mucho appreciated!

Mr. B
Nov 20 '05 #1
5 1647
You will find the answers to all 3 of your questions in the VB.Net
documentation where they are covered very thoroughly.

"Mr. B" <Us**@NoWhere.Com> wrote in message
news:jp********************************@4ax.com...
Question #1:

I've two forms (Parent = Form1, Child = Form2). How do I find the status of a control (say RadioButton) on Form1, while I'm doing something on Form2.

VB6 use to allow you to do ==>
If Form1.rbMyButton.Checked = True then blahblahblah

How do I do this in VB.net?
Question #2:
If I have a HIDE button for my Parent Form1 (using ContexMenu and NotifyIcon), how can I tell the "show" status of my Child Form2 so I can close it when I hide my Parent?
Question #3:
I've seen examples where the word "NEW" is used in defining something. An
example is:

Me.bttnScan = New System.Windows.Forms.Button()
===

When and why do you 'need' to use the word "New"? I'm kinda curious.

Answers mucho appreciated!

Mr. B

Nov 20 '05 #2
Q1: On Form2 you can use Me.ParentForm.RadioButton, assuming that you have
exposed 'RadioButton' as a public property on Form1.
Q2: You need to maintain the reference to your Form2 and check
Form2.Visible.
Q3: Without the New, you only create a reference variable, the New actually
creates the variable.

The biggest thing to remember, as far as I have learned now, is that in
VB.NET, basically, you create, position and set every single control and
parameter. In VB6 and before, this was all taken care of you behind the
scenes by the runtime. If you open an old FRM file from VB6, you would
actually see all these control statement blocks, that arent visible when
your in the development environment. The VB.NET development
environment/form designer does create all this for you and 'folds' it in the
program code, but you can access it.

The second biggest thing to remember is that controls don't seem to have
'Names' anymore, there are all object variables to be accessed, and the
variable 'Name' is the name of the control. For example, in VB6, there may
be a control named TextBox1, but in VB.NET there is a variable in your form
code called TextBox1, the is used with the "New" operator to create a class
TextBox, then location, size and position information is applied to that
control, and eventually the control 'variable' is added to the Form's
Controls property.

This is all very, very in-depth and complicated for poor folk coming
strictly from a VB5 or VB6 environment, luckily I have some C++ and Java
experience which really helps out.

"Mr. B" <Us**@NoWhere.Com> wrote in message
news:jp********************************@4ax.com...
Question #1:

I've two forms (Parent = Form1, Child = Form2). How do I find the status of a control (say RadioButton) on Form1, while I'm doing something on Form2.

VB6 use to allow you to do ==>
If Form1.rbMyButton.Checked = True then blahblahblah

How do I do this in VB.net?
Question #2:
If I have a HIDE button for my Parent Form1 (using ContexMenu and NotifyIcon), how can I tell the "show" status of my Child Form2 so I can close it when I hide my Parent?
Question #3:
I've seen examples where the word "NEW" is used in defining something. An
example is:

Me.bttnScan = New System.Windows.Forms.Button()
===

When and why do you 'need' to use the word "New"? I'm kinda curious.

Answers mucho appreciated!

Mr. B

Nov 20 '05 #3
Is that supposed to be helpful or are you just pouring scorn tonight?
Nov 20 '05 #4
I agree, with all due respect, I'm sure she is very knowledegable, but maybe
one day she will stop being so hard on mere mortals and remember that she
was once a less experienced person.

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:Oi*************@TK2MSFTNGP11.phx.gbl...
Is that supposed to be helpful or are you just pouring scorn tonight?

Nov 20 '05 #5
With Deft Fingers, "Richard Brown" <rb****@easylift.org> wrote:
Q1: On Form2 you can use Me.ParentForm.RadioButton, assuming that you have
exposed 'RadioButton' as a public property on Form1.
Q2: You need to maintain the reference to your Form2 and check
Form2.Visible.
Q3: Without the New, you only create a reference variable, the New actually
creates the variable.


Thanks... brief but explains much.

Bruce
Nov 20 '05 #6

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

Similar topics

1
by: yiyun | last post by:
Hi, I am new to mysql and I want to ask a simple questions. I would like to initialize my InnoDB table space and I configure like below: ...
18
by: Geoff Cox | last post by:
Hello, I am trying to print out the array values for a second time but get error on page message? Thanks Geoff <html>
1
by: Proteus | last post by:
Any help appreciated on a small perl project I need to write for educator/teaching purposes. I have not programmed perl for some time, need to get up to speed, maybe some kind souls hrere will help...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
1
by: chelisek | last post by:
I have two simple questions: I am trying to create a document using an excel spreadsheet format. I am trying to create a column that will contain numbers, just plain numbers as in account numbers...
1
by: Itanium | last post by:
Hi all! I'm new to .NET Platform and got some simple questions about efficiency... To put you in situation, to say that I'm involved in the writing of a complex regex based lexer for use over...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
4
by: maheshgupta0248 | last post by:
Hi all, Im a newbie in php, started learning php on my own. I want to create small website using php, that contains links for two simple webpages > C questions > C++ questions C questions...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.