Closing one form from another and resizing the entire form at runtime 
Author Message
 Closing one form from another and resizing the entire form at runtime

First, I have 2 main forms in my program. The second is called from the
first as a modal form.
form1
- instructions1
- form2
   - instructions2

I also have separate forms to display instructions for each of the main
2. Since I want the user to be able to switch back and forth between the
instructions and the form they are on I made those 2 nonmodal.

When exiting the modal form2 I want to close the instructions2 form if
it has been opened. So far, I have not been able to discover the
commands to make it happen.

Second, when the form runs and I try and resize it, it only resizes the
form background, hiding other items on the form. I have not found the
correct controls so far to either make the entire form plus components
shrink or grow together, or at least give scroll bars to be able to
display the other area's.

Can someone point me in the right direction for both please?
Thanks
--
Robert Johnson



Thu, 08 Dec 2005 11:18:49 GMT  
 Closing one form from another and resizing the entire form at runtime
Robert,

You need to store a persistent reference to the
instructions form for form2.  In this way, you can access
the instruction form's Close() method.  

For example

Public Class myForm

  Private frm As myInstructionForm

  Private Sub launchInstructions()
    Me.myInstructionForm = New myInstructionForm()
    Me.myInstructionForm.Show()
  End Sub

  Private Sub closeInstructionForm()
    Me.myInstructionForm.Close()
  End Sub

End Classs

For resizing, use the Anchor and Dock properties for the
controls you want to adjust automatically when the form
resizes.

Randy

Quote:
>-----Original Message-----
>First, I have 2 main forms in my program. The second is
called from the
>first as a modal form.
>form1
>- instructions1
>- form2
>   - instructions2

>I also have separate forms to display instructions for
each of the main
>2. Since I want the user to be able to switch back and
forth between the
>instructions and the form they are on I made those 2
nonmodal.

>When exiting the modal form2 I want to close the

instructions2 form if

- Show quoted text -

Quote:
>it has been opened. So far, I have not been able to
discover the
>commands to make it happen.

>Second, when the form runs and I try and resize it, it
only resizes the
>form background, hiding other items on the form. I have
not found the
>correct controls so far to either make the entire form
plus components
>shrink or grow together, or at least give scroll bars to
be able to
>display the other area's.

>Can someone point me in the right direction for both
please?
>Thanks
>--
>Robert Johnson

>.



Thu, 08 Dec 2005 15:21:37 GMT  
 Closing one form from another and resizing the entire form at runtime
One that isn't shown in the books I have. It worked perfect.
Thanks Randy.
Rob

Quote:

> Robert,

> You need to store a persistent reference to the
> instructions form for form2.  In this way, you can access
> the instruction form's Close() method.  

> For example

> Public Class myForm

>   Private frm As myInstructionForm

>   Private Sub launchInstructions()
>     Me.myInstructionForm = New myInstructionForm()
>     Me.myInstructionForm.Show()
>   End Sub

>   Private Sub closeInstructionForm()
>     Me.myInstructionForm.Close()
>   End Sub

> End Classs

> For resizing, use the Anchor and Dock properties for the
> controls you want to adjust automatically when the form
> resizes.

> Randy

>>-----Original Message-----
>>First, I have 2 main forms in my program. The second is

> called from the

>>first as a modal form.
>>form1
>>- instructions1
>>- form2
>>  - instructions2

>>I also have separate forms to display instructions for

> each of the main

>>2. Since I want the user to be able to switch back and

> forth between the

>>instructions and the form they are on I made those 2

> nonmodal.

>>When exiting the modal form2 I want to close the

> instructions2 form if

>>it has been opened. So far, I have not been able to

> discover the

>>commands to make it happen.

>>Second, when the form runs and I try and resize it, it

> only resizes the

>>form background, hiding other items on the form. I have

> not found the

>>correct controls so far to either make the entire form

> plus components

>>shrink or grow together, or at least give scroll bars to

> be able to

>>display the other area's.

>>Can someone point me in the right direction for both

> please?

>>Thanks
>>--
>>Robert Johnson

>>.

--
Robert Johnson
623-977-8588
623-876-1553(fax)


Fri, 09 Dec 2005 00:00:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Forms within TabStrip and one overtaking entire form

2. Forms, primary thread closing when closing startup form

3. Form Close Button Does Not Close the Form

4. Open form, close form, open form = disposed object exception

5. load another form form one form

6. Resize event not called when closing maximized form

7. resizing a form size at runtime

8. Resize form at runtime?

9. Resizing forms at runtime

10. VB 6.0 - Forms resize at runtime

11. Resize Form in One Direction Only

12. Resizing a form only in one direction

 

 
Powered by phpBB® Forum Software