DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4

Thread: Two forms

  1. #1
    Max Guest

    Two forms


    Hi,
    I have two forms. the one is created from the other:

    Dim frmPicture As Form
    frmPicture = New frmPicture()

    frmPicture.ShowDialog

    My idea is that before showing I want to put a picture in a picturebox on
    the frmPicture form a file.

    frmPicture.pctPicture.Image.FromFile(strFile)

    But I don't have access to it. Tells me that pctPicture is not a member of
    the System.Windows.Forms.Form, which is the absolute true.

    What is the way to do it?

    Thanks
    Max

  2. #2
    McCleud Guest

    Re: Two forms


    "Max" <max_saint@yahoo.com> wrote:
    >
    >Hi,
    >I have two forms. the one is created from the other:
    >
    > Dim frmPicture As Form
    > frmPicture = New frmPicture()
    >
    > frmPicture.ShowDialog
    >
    >My idea is that before showing I want to put a picture in a picturebox on
    >the frmPicture form a file.
    >
    > frmPicture.pctPicture.Image.FromFile(strFile)
    >
    >But I don't have access to it. Tells me that pctPicture is not a member

    of
    >the System.Windows.Forms.Form, which is the absolute true.
    >
    >What is the way to do it?
    >
    >Thanks
    >Max



    If I am understanding your intention I think you can just do the following.

    Dim NewForm As New frmPicture
    NewForm.pctPicture.Image etc etc






  3. #3
    Phil Weber Guest

    Re: Two forms

    > Dim NewForm As New frmPicture
    > NewForm.pctPicture.Image, etc., etc.


    Max: You'll also need to declare pctPicture as Public in frmPicture.
    ---
    Phil Weber



  4. #4
    Static Guest

    Re: Two forms


    "Max" <max_saint@yahoo.com> wrote:
    >
    >Hi,
    >I have two forms. the one is created from the other:
    >
    > Dim frmPicture As Form
    > frmPicture = New frmPicture()
    >
    > frmPicture.ShowDialog
    >
    >My idea is that before showing I want to put a picture in a picturebox on
    >the frmPicture form a file.
    >
    > frmPicture.pctPicture.Image.FromFile(strFile)
    >
    >But I don't have access to it. Tells me that pctPicture is not a member

    of
    >the System.Windows.Forms.Form, which is the absolute true.
    >
    >What is the way to do it?
    >
    >Thanks
    >Max




    You need to declare it as Public, I have trouble with that as well.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links