Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

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!

[EDIT]
C++
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
Updated 18-Apr-12 21:53pm
v3

1 solution

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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900