Click here to Skip to main content
12,701,601 members (34,659 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ MFC VisualC++

I've 2 sliders (1 horizontal, 1 vertical) control and a custom control in my program.
The sliders are position at the bottom and right of the custom control.

When I setbuddy() to the custom control. The custom control will move to the bottom right of my computer screen. I've than moved the custom control back to its original position using MoveWindow().

But when I lock my computer using the "windows-key + L", and log back in. the custom control, moves back to the bottom right of my computer screen.

Can anyone tell me why? And how can i solve this problem?
Thanks for your help!

m_sliderHorizontal.SetBuddy(&m_ChartCtrl, FALSE);
m_slidervertical.SetBuddy(&m_ChartCtrl, FALSE);

where m_ChartCtrl is the custom control.

I've tried all possible combinations of the BOOL parameters. But it still moves the custom control after i lock and log-in again. Is there anyway to lock the custom control position?
Posted 18-Apr-12 22:24pm
Updated 18-Apr-12 22:53pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I've solved the problem. Its seems that I need to call the
function in the dialog's
instead of calling it after I set the buddy.

This ensures that the custom control is always in the position that I wanted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 19 Apr 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100