Setting Text Controls X and Y Position in a Dialog Window
-
I have a Visual C++ application running in Visual Studio.net. It will have numerous dialog windows that will display labels and data. The labels and data will be displayed in Text Controls. There are IDC_XXX names for the labels and data. What I need to do is dynamically place the labels and data on the Windows dialog given X and Y coordinates. I cant use a static dialog in my rc resource file. QUESTION: Can I move the controls on the dialog given X, Y coordinates? If so, can someone tell me how this is done??...and how the X, Y system works in a dialog window. Where is 0,0 etc...?? Thanks, Jerry :)
-
I have a Visual C++ application running in Visual Studio.net. It will have numerous dialog windows that will display labels and data. The labels and data will be displayed in Text Controls. There are IDC_XXX names for the labels and data. What I need to do is dynamically place the labels and data on the Windows dialog given X and Y coordinates. I cant use a static dialog in my rc resource file. QUESTION: Can I move the controls on the dialog given X, Y coordinates? If so, can someone tell me how this is done??...and how the X, Y system works in a dialog window. Where is 0,0 etc...?? Thanks, Jerry :)
jerry1211a wrote:
Where is 0,0 etc...??
Just above and to the left of 1,1 Use
SetWindowPos()
orMoveWindow()
, don't ask me for an example, ask your teacher. -
I have a Visual C++ application running in Visual Studio.net. It will have numerous dialog windows that will display labels and data. The labels and data will be displayed in Text Controls. There are IDC_XXX names for the labels and data. What I need to do is dynamically place the labels and data on the Windows dialog given X and Y coordinates. I cant use a static dialog in my rc resource file. QUESTION: Can I move the controls on the dialog given X, Y coordinates? If so, can someone tell me how this is done??...and how the X, Y system works in a dialog window. Where is 0,0 etc...?? Thanks, Jerry :)
jerry1211a wrote:
Can I move the controls on the dialog given X, Y coordinates?
Are you looking for
MoveWindow()
orSetWindowPos()
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
jerry1211a wrote:
Can I move the controls on the dialog given X, Y coordinates?
Are you looking for
MoveWindow()
orSetWindowPos()
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
Actually what I have is a dialog window with no controls at this point. I want to write text, numbers, etc to the window, using X, Y coordinates. I thought I could do this but have forgotten how... :) Jerry
-
Actually what I have is a dialog window with no controls at this point. I want to write text, numbers, etc to the window, using X, Y coordinates. I thought I could do this but have forgotten how... :) Jerry
The only other way I know of is with
TextOut()
orDrawText()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
The only other way I know of is with
TextOut()
orDrawText()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
I can use that Ok, but I need to get the device context for the dialog I created. Is there a call to get the device context? Thanks. Jerry
-
I can use that Ok, but I need to get the device context for the dialog I created. Is there a call to get the device context? Thanks. Jerry
jerry1211a wrote:
Is there a call to get the device context?
GetDC()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
jerry1211a wrote:
Is there a call to get the device context?
GetDC()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
Thank You... Have a good day. :)