Thread: Trackbar controls

  1. #1
    Registered User dalek's Avatar
    Join Date
    May 2003

    Trackbar controls

    Hi all - just wondering if someone can help me out here. I have created a Trackbar and given it a buddy edit control, much like you do with a spinner control - but I have noticed that there isn't an equivalent style for the UDS_SETBUDDYINT. Can I presume then we are responsible for updating the buddy edit control, and if so, what is the point of setting a buddy control?

    		hwndSlider = CreateWindowEx(0, TRACKBAR_CLASS, NULL, WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_AUTOTICKS, 10, 10, 200, 40, hwnd,
    									(HMENU) ID_TRACKBAR, hInstance, NULL);
    		hwndBuddy = CreateWindowEx(0, TEXT("edit"), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, 0, 0, 50, 20, hwnd,
    								   (HMENU) ID_BUDDY, hInstance, NULL);
    		SendMessage(hwndSlider, TBM_SETBUDDY, (WPARAM) FALSE, (LPARAM)hwndBuddy);
    Cheers all.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Good point.
    From the documentation, its sounds like it's just for posistioning the buddy window relative to the control.


  3. #3
    Registered User dalek's Avatar
    Join Date
    May 2003
    Yeah, I have just processed the WM_HSCROLL / WM_VSCROLL messages for the control (depending on orientation) and updated the buddy control with a message to it. Works fine, just thought it was odd that there wasn't an equivalant for the trackbar control, and was hoping it wasn't my brain...
    Last edited by dalek; 05-12-2004 at 10:45 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Controlling a trackbar
    By bigdan43 in forum C++ Programming
    Replies: 1
    Last Post: 08-24-2005, 11:24 AM
  2. Controls
    By osal in forum Windows Programming
    Replies: 7
    Last Post: 06-11-2004, 10:38 AM
  3. Subclassing controls
    By filler_bunny in forum Windows Programming
    Replies: 3
    Last Post: 04-28-2004, 05:43 PM
  4. I need help disabling Keyboard and Mouse input on Edit controls
    By Templario in forum Windows Programming
    Replies: 4
    Last Post: 01-07-2003, 12:59 AM
  5. MFC Controls and Thread Safety :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 11:36 AM