-
June 25th, 2013, 02:03 PM
#1
Call Private sub fromm mdiForm
I have mdiForm1 and Form1 as child
In Form1 I have a Menu mnuClear
Sure you can call this menu from mdiForm (button in PictureBox)
This procedure deletes the values of local variables and they can not put in the module as Public Sub
Form1 is a document that can be opened with the command New. So I variables dimensioned in Form1 and not in a module as Public. If they were Public then they would be the same value in all open Form1 ...
-
July 1st, 2013, 10:56 AM
#2
Re: Call Private sub fromm mdiForm
I'd make use of Properties here, instead of public / private variables.
Just a suggestion
-
July 8th, 2013, 08:37 PM
#3
Re: Call Private sub fromm mdiForm
Properties is the way to go for sure but you can also use variables if that is the way you want to do it. The variables have to be public and have to be declared within the forms declarations section.
You can not access private variables from any other form, class or module they are private to the container they are declared in.
When access a public variable in a form or class you must prefix the from or class unto the variable name
i.e. Form1.MyVar
This method will allow you to have more than 1 copy of the form in memory and each have its own unique variables, still properties is a better choice.
Always use [code][/code] tags when posting code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|