CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    362

    How to resize a control through code

    Hi All,
    I have created a very simple activex control. I want to resize it through code.I tried putting MoveWindow(..) in OnDraw. But it doesn't seem to work.Can anybody pls help me out?

    Thanx,
    Meenu

  2. #2
    Join Date
    Jan 2004
    Location
    Punjab, India
    Posts
    113
    Strange, movewindow should do the trick. can u post your code and elaborate a bit about what you wanna do.

  3. #3
    Join Date
    Dec 2003
    Posts
    362
    I haven't done much..In OnDraw function of the activexcontrol class, I call MoveWindow as follows

    void COnOffControlCtrl::OnDraw(
    CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
    {
    DoSuperclassPaint(pdc, rcBounds); //Wizard generated code

    MoveWindow(rcBounds.left, rcBounds.top, 1000, 1000, TRUE);

    }

  4. #4
    Join Date
    Apr 2003
    Location
    Athens, Greece
    Posts
    1,094
    Why did you put the code in OnDraw()?
    Do you really want the resizing to happen every time it is Drawn?

    I would prefer letting the application using the control decide when and how to resize it.
    Extreme situations require extreme measures

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