CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2001
    Posts
    1

    change MDI caption at runtime

    Hi,
    I have 1 form which needs to be called from 2 different forms. The caption of the MDI form needs to be changed depending on from which form its called.
    Can i do that and how ??
    Regards,
    Priya



  2. #2
    Join Date
    Jul 2001
    Location
    Salzburg, Austria
    Posts
    126

    Re: change MDI caption at runtime

    In a .Bas module define, where frmMain is your MDIForm.


    public fMainForm as frmMain
    public Sub InitMain()
    set fMainForm = new frmMain
    End Sub




    In your Main() sub, call InitMain.
    Then, along the programm you can call all the properties of the fMainForm MDIForm (f.e. Caption).
    I hope it helps.
    Jaime.


  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: change MDI caption at runtime

    This code can be called from anywhere (like in the load event of one of the two other forms), assuming the MDI form is called frmMain.

    frmMain.Caption = "new caption"




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured