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

    HELP!! Resizing and moving a child edit control within a dialog based app

    Hello,
    I am new to Windows Programming, especially the UI part.... I am facing this problem:
    I am writing a dialog based app, that contains a child edit control. I want to decrease the height of the edit control (say, by 'n' units), and shift its position downward by 'n' units.... in a way, creating space above the edit control, to dynamically create other controls. Except for the height and vertical position of the control, nothing changes.

    I don't know how to accomplish this. I would appreciate if you could help me out with this.

    Thanks a lot in advance,
    Narasimha


  2. #2
    Join Date
    Apr 1999
    Posts
    65

    Re: HELP!! Resizing and moving a child edit control within a dialog based app

    Hi buddy,
    I'm not sure but try using SetWindowPos...
    There u have options for noresize and nomove and a lot more
    hope this helps
    anuvk


  3. #3
    Join Date
    Apr 1999
    Location
    SungNam KyungKi Korea
    Posts
    14

    Re: HELP!! Resizing and moving a child edit control within a dialog based app

    anuvk is right!

    try this!
    say " Move edit-contrl to the position where Left-Mouse-Button is clicked. "

    void CMyDlg::OnLButtonDown(UINT nFlags, CPoint point)
    {
    //TODO: Add...
    CEdit *pEdit=(CEdit *)GetDlgItem(IDC_EDIT1);
    pEdit->SetWindowPos(NULL,point.x,point.y,30,40,SWP_DRAWFRAME);

    CDialog::OnLButtonDown(nFlags,point);
    }

    I hope that this solution is your answer!


    by <I><font color=cyan>nfuox</font></I>

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