473,378 Members | 1,620 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,378 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
Jul 21 '05 #1
5 1631
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

Jul 21 '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

Jul 21 '05 #3
Is that supposed to be helpful or are you just pouring scorn tonight?
Jul 21 '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?

Jul 21 '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
Jul 21 '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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.