CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    32

    how to move a control

    the control like edit control, button contol etc

    how to move these controls in runtime

    i mean user can have to move the control where ever he wants with in the dialogbox

  2. #2
    Join Date
    Feb 2004
    Posts
    11

    Re: how to move a control

    I personally like to use CRectTracker. Even though it was intended for OLE controls it can be used for just about anything. Granted, you have to use MoveWindow somewhere in your logic to actually move the window but CRectTracker gives you visible border options, hit testing, and handles so it saves you some time in development.

  3. #3
    Join Date
    Jun 2003
    Location
    Bucharest, Romania
    Posts
    529

    Re: how to move a control

    Quote Originally Posted by bob16972
    I personally like to use CRectTracker. Even though it was intended for OLE controls it can be used for just about anything. Granted, you have to use MoveWindow somewhere in your logic to actually move the window but CRectTracker gives you visible border options, hit testing, and handles so it saves you some time in development.
    can you provide a simple project sample that uses CRectTracker? I would apreciate it!
    Help me help you ... rate this article if any good!

  4. #4
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: how to move a control

    Quote Originally Posted by chi_luci
    can you provide a simple project sample that uses CRectTracker? I would apreciate it!
    Take a look at the MSDN samples TRACKER (simple) and DRAWCLI (a more complex object-oriented 2D drawing application).

  5. #5
    Join Date
    Jun 2003
    Location
    Bucharest, Romania
    Posts
    529

    Re: how to move a control

    Quote Originally Posted by ravirams
    the control like edit control, button contol etc

    how to move these controls in runtime

    i mean user can have to move the control where ever he wants with in the dialogbox
    maybe this thread will help you..
    dowload the attached project and see for yourself..
    Help me help you ... rate this article if any good!

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: how to move a control

    Quote Originally Posted by chi_luci
    can you provide a simple project sample that uses CRectTracker? I would apreciate it!
    Attached here is a very simple example that shows how to use CRectTracker to allow user to move/resize a button at run-time.
    Attached Files Attached Files
    Last edited by ovidiucucu; March 20th, 2005 at 09:41 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Jun 2003
    Location
    Bucharest, Romania
    Posts
    529

    Question Re: how to move a control

    Quote Originally Posted by ovidiucucu
    Attached here is a very simple example that shows how to use CRectTracker to allow user to move/resize a button at run-time.
    very nice sample! Easy and simple.. I couldn't imagine it would be so simple!
    Only it has one problem: what happens if you move the button outside???
    well, I guess limiting the track to a RECT area would be very helpfull!
    If you know how to do this, pls, pls help!!!
    Help me help you ... rate this article if any good!

  8. #8
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: how to move a control

    Quote Originally Posted by chi_luci
    well, I guess limiting the track to a RECT area would be very helpfull! If you know how to do this, pls, pls help!!!
    The answer is given in this thread (post #15).

  9. #9
    Join Date
    Jun 2003
    Location
    Bucharest, Romania
    Posts
    529

    Re: how to move a control

    Quote Originally Posted by gstercken
    The answer is given in this thread (post #15).
    thanks!
    Help me help you ... rate this article if any good!

  10. #10
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: how to move a control

    Quote Originally Posted by chi_luci
    very nice sample! Easy and simple.. I couldn't imagine it would be so simple!
    Only it has one problem: what happens if you move the button outside???
    well, I guess limiting the track to a RECT area would be very helpfull!
    If you know how to do this, pls, pls help!!!
    Please professor, don't give me an F. I had a headache today and I made my homework too simple.
    BTW. Many colleagues asked me if it's possile to track a button outside a dialog template in Visual C++ resource editor. Please tell me how! Pliz, pliz, Pliiiiiizzzzzzzzzz!!!!
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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