Show information in the same dialog after press diferent button
-
Ok, finally, I got my answer. I solved of this way: I made a public variable of my dialog class, where is the edit control, in the class view, and I made the windows in the builder. After, when I press a button, I did :
void Cprueba4View::OnButton3()
{CString cadena; dlgDesc->GetDlgItemText(IDC\_EDIT1, cadena); cadena += "Hello other time "; dlgDesc->SetDlgItemText(IDC\_EDIT1, cadena); dlgDesc->SetFocus();
}
But now, I have another problem. When I maximize the windows dialog, only it's maximized the windows and not the edit control. why? how can I maximize the windows and the edit control at the same time? I used
dlgDesc->ShowWindow(SW\_MAXIMIZE);
to maximized
antonio343 wrote:
how can I maximize the windows and the edit control at the same time?
Why can't you use
SetWindowPos()
on the edit control? It's a window too."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
antonio343 wrote:
how can I maximize the windows and the edit control at the same time?
Why can't you use
SetWindowPos()
on the edit control? It's a window too."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
I tried this, but it can't run. I did this:
BOOL CEjemplo::OnInitDialog()
{
CDialogEx::OnInitDialog();// TODO: Agregue aquí la inicialización adicional m\_Edit.SetMargins(10,10); m\_Edit.ShowWindow(SW\_MAXIMIZE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPCIÓN: las páginas de propiedades OCX deben devolver FALSE
}
is it right? If not.. how I use showWindow()?
-
I tried this, but it can't run. I did this:
BOOL CEjemplo::OnInitDialog()
{
CDialogEx::OnInitDialog();// TODO: Agregue aquí la inicialización adicional m\_Edit.SetMargins(10,10); m\_Edit.ShowWindow(SW\_MAXIMIZE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPCIÓN: las páginas de propiedades OCX deben devolver FALSE
}
is it right? If not.. how I use showWindow()?
antonio343 wrote:
I tried this, but it can't run.
Which means what?
antonio343 wrote:
m_Edit.SetMargins(10,10);
Are you thinking that setting a control's margins will also affect it's physical dimensions?
antonio343 wrote:
m_Edit.ShowWindow(SW_MAXIMIZE);
Unless the control's width and height have been changed (see
SetWindowPos()
), it is already maximized."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
antonio343 wrote:
I tried this, but it can't run.
Which means what?
antonio343 wrote:
m_Edit.SetMargins(10,10);
Are you thinking that setting a control's margins will also affect it's physical dimensions?
antonio343 wrote:
m_Edit.ShowWindow(SW_MAXIMIZE);
Unless the control's width and height have been changed (see
SetWindowPos()
), it is already maximized."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
m_Edit.SetMargins(10,10);
is so that the text don't appear next to the border. Ok, I will try with SetWindowPos. I will tell you my progress
-
m_Edit.SetMargins(10,10);
is so that the text don't appear next to the border. Ok, I will try with SetWindowPos. I will tell you my progress
I dont know how to use this function. Please, teach me.