change the dilog title at runtime - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: change the dilog title at runtime

  1. #16
    Join Date
    Aug 2008
    Posts
    373

    Re: change the dilog title at runtime

    Quote Originally Posted by florivucu View Post
    what exactly do you want to see? the code is too large so....
    Create a hwnd of child dialog and SetWindowText part.

  2. #17
    Join Date
    Nov 2009
    Posts
    40

    Re: change the dilog title at runtime

    I do not know how to create a hwnd of the dialog. Can you tell me? In the cosntructor of the dialog I have the Create (MyClass::IDD, pParent). Creating another pointer to the class would not generate the error I've got?

  3. #18
    Join Date
    Aug 2008
    Posts
    373

    Re: change the dilog title at runtime

    ok can you tell here what you want to do?.When you call SetWindowText?

  4. #19
    Join Date
    Nov 2009
    Posts
    40

    Re: change the dilog title at runtime

    In the MainWindow (in the menu) I'm calling the same dialog for two different menus:Estimare and Calcul Tui Manual. Depending on what I choose I want to set the title of the dialog according to the menu. I've done that with SetWindowText but this command changes the name of the main window called "Calipso - bla bla". I tried to use a parameter (&ttitle)in the caption of the dialog but I could not set it properly. In the OnEstim function (Mainframe menu) I have
    .....
    litera = "E";
    {
    ...... new CTuiDataInputDlg(this); // the dialog class
    this->SetWindowText("Estimare"); this is not working
    ........ }
    .......

    In the OnInitDialog of the class I have those line with SetWindowText.

  5. #20
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,067

    Re: change the dilog title at runtime

    Quote Originally Posted by florivucu View Post
    In the MainWindow (in the menu) I'm calling the same dialog for two different menus:Estimare and Calcul Tui Manual. Depending on what I choose I want to set the title of the dialog according to the menu. I've done that with SetWindowText but this command changes the name of the main window called "Calipso - bla bla". I tried to use a parameter (&ttitle)in the caption of the dialog but I could not set it properly. In the OnEstim function (Mainframe menu) I have
    .....
    litera = "E";
    {
    ...... new CTuiDataInputDlg(this); // the dialog class
    this->SetWindowText("Estimare"); this is not working
    ........ }
    .......

    In the OnInitDialog of the class I have those line with SetWindowText.
    Before or after the call to CDialog::OnInitDialog()? If it's before, move it after.

    litera = "E" Are you sure you want to use an assignment operator there? You should provide more information when asked. It seems you have other problems too.

  6. #21
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: change the dilog title at runtime

    Quote Originally Posted by florivucu View Post
    In the MainWindow (in the menu) I'm calling the same dialog for two different menus:Estimare and Calcul Tui Manual. Depending on what I choose I want to set the title of the dialog according to the menu. I've done that with SetWindowText but this command changes the name of the main window called "Calipso - bla bla". I tried to use a parameter (&ttitle)in the caption of the dialog but I could not set it properly. In the OnEstim function (Mainframe menu) I have
    .....
    litera = "E";
    {
    ...... new CTuiDataInputDlg(this); // the dialog class
    this->SetWindowText("Estimare"); this is not working
    ........ }
    .......

    In the OnInitDialog of the class I have those line with SetWindowText.
    WHERE IS THIS CODE FROM? I see you create a new dialog and set "this" as its parent. But then you call SetWindowText() for "this", which is the parent. Is this "this" the main frame? Then of course you change the title of the main frame, for god's sake.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  7. #22
    Join Date
    Nov 2009
    Posts
    40

    Re: change the dilog title at runtime

    OK. You are very right. I forgot those line. Now it is ok. Thanks. And sorry for my stupid questions.

Page 2 of 2 FirstFirst 12

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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center