CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Edit Box size

  1. #1
    Join Date
    Mar 2002
    Posts
    151

    Edit Box size

    how can i change the size of my edit control accordingly when the user maximises or restores the dialog window. I tried to use WM_SIZE, but I am not able to implement it. Pl help.



  2. #2
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776

    Re: Edit Box size

    hi
    use SetWindowPos() function for this:
    sample code:

    CWnd *myEdit=GetDlgItem(IDC_EDIT1);
    myEdit->SetWindowPos(,,,,);

    See this SetWindowPos() in msdn for details

    Regards
    SKP

    Be sure to rate answers if it helped, to encourage them.

  3. #3
    Join Date
    Mar 2002
    Posts
    151

    Re: Edit Box size

    I tried to use your suggestion in the way
    CWnd *myEditBox = GetDlgItem(IDC_EDIT1);
    myEditBox->SetWindowPos(&wndTopMost,0,0,200,500,SWP_SHOWWINDOW);


    but it gives memory error. I wrote the about func in the OnSize mess handler.


  4. #4
    Join Date
    Sep 2001
    Location
    U.S.
    Posts
    61

    Re: Edit Box size

    do it as in OnSize



    CEdit* edit = (CEdit*)GetDlgItem(ID_OF_UR_CONTROL);
    if(edit)
    {
    //x = left;
    //y = top;
    //cx = right;
    //cy = bottom;

    edit->MoveWindow(x,y,cx,cy);
    }




    Hope this helps

    All Luck!

  5. #5
    Join Date
    Mar 2002
    Posts
    151

    Re: Edit Box size

    Thanx...


  6. #6
    Join Date
    Apr 2003
    Posts
    3
    how to get current position of Edit Box on my Dialog , so i can resize it in its designed position ??

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