Results 1 to 3 of 3

Thread: Referencing a run-time created form

  1. #1

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    Referencing a run-time created form

    I am using this code to create a new form...
    VB Code:
    1. Dim frmShow As New Form
    2.         With frmShow
    3.             .WindowState = FormWindowState.Maximized
    4.             .MaximizeBox = False
    5.             .MinimizeBox = False
    6.             .BackColor = System.Drawing.Color.Black
    7.         End With
    8.         frmShow.Show()
    In a different subroutine, I wanted to reference the now open "frmShow"

    What should I do?
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Your code is obviously inside a sub routine and frmShow will cease to exist when you exit that sub.

    Put the declaration as public in the genaral section of the appropriate form or module .

    VB Code:
    1. Public frmShow as New Form
    Last edited by taxes; Jul 6th, 2004 at 08:27 PM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243
    Yes, thank you...
    I keep forgetting about the basics while trying to figure out the changes with .NET
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width