PC Review


Reply
Thread Tools Rate Thread

3 Simple Questions

 
 
Mr. B
Guest
Posts: n/a
 
      7th Sep 2003
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
 
Reply With Quote
 
 
 
 
Stephany Young
Guest
Posts: n/a
 
      7th Sep 2003
You will find the answers to all 3 of your questions in the VB.Net
documentation where they are covered very thoroughly.

"Mr. B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Richard Brown
Guest
Posts: n/a
 
      7th Sep 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Fergus Cooney
Guest
Posts: n/a
 
      7th Sep 2003
Is that supposed to be helpful or are you just pouring scorn tonight?


 
Reply With Quote
 
One Handed Man [ OHM ]
Guest
Posts: n/a
 
      7th Sep 2003
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" <filter-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is that supposed to be helpful or are you just pouring scorn tonight?
>
>



 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      9th Sep 2003
With Deft Fingers, "Richard Brown" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple questions for simple 2 PC file sharing network. Simple? raylopez99 Microsoft Windows 2000 Networking 3 11th Feb 2007 01:31 PM
Questions should be simple please help =?Utf-8?B?YmFiaWlnaXJs?= Microsoft Excel Worksheet Functions 3 14th Jun 2006 07:24 PM
Probably simple questions Maggy Windows XP General 2 2nd Jul 2004 08:49 AM
2 simple questions =?Utf-8?B?T3Jlbg==?= Microsoft ASP .NET 0 8th Apr 2004 12:51 PM
2 simple questions about ado/xml suzy Microsoft ADO .NET 0 27th Oct 2003 08:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.