Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC C++/MFC VC VC++
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]
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
skfoo1691
Edited 18-Apr-12 22:53pm
v3

1 solution

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

Solution 1

I've solved the problem. Its seems that I need to call the
MoveWindow()
function in the dialog's
OnPaint()
instead of calling it after I set the buddy.
 
This ensures that the custom control is always in the position that I wanted.
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 19 Apr 2012
Copyright © CodeProject, 1999-2014
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