CSliderCtrl::SetPos() Problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: CSliderCtrl::SetPos() Problem

  1. #1
    Join Date
    Jun 2006
    Location
    Germany
    Posts
    103

    CSliderCtrl::SetPos() Problem

    Hi community,
    i have a problem to set sliderposition programmaticaly, it would be great if someone can help?

    This is my try:

    //pointer to my slider control:
    // On the begining the range ist 1 to 10
    // and the position is on 5
    // change the range:
    pSliderCtrl->SetRange(1, 100); // ok no problems

    // Now, how to "move" btw. how to redraw the position of the slider thumb
    // programmaticaliy with c++? Need to send some message, if yes what message i need to send to slider control to move (reposition) the slider thumb?
    I try with
    // first:
    ::SendMessage(pSlider->m_hWnd, WM_NOTIFY, TRBN_THUMBPOSCHANGING, 0);
    // then with:
    ::SendMessage(pSlider->m_hWnd, WM_NOTIFY, NM_RELEASEDCAPTURE, 0);

    but nothing happens?

    i know i do something wrong, but what?

    Thanks in advance
    break;
    Last edited by break;; January 31st, 2014 at 07:41 AM.

  2. #2
    Join Date
    Nov 2011
    Location
    India
    Posts
    128

    Re: CSliderCtrl::SetPos() Problem

    Regards,

    SaraswathiSrinath

  3. #3
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    7,994

    Re: CSliderCtrl::SetPos() Problem

    To change the current slider thumb position, call CSliderCtrl::SetPos or send TBM_SETPOS message (CSliderCtrl::SetPos sends this message itself).

    TRBN_THUMBPOSCHANGING and NM_RELEASEDCAPTURE are notifications sent via WM_NOTIFY to the control's parent window, as a result of a user action.
    Last edited by ovidiucucu; February 1st, 2014 at 07:00 AM.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

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