|
You can use m_list.SetWindowPos( &wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE );
And I expect some painting issues...
m_edit.ModifyStyle( 0, WS_CLIPSIBLINGS ); may solve that issue.
Dont forget to let me know the results...
- NS -
|
|
|
|
|
I presume the two controls have the same coordinates, and you are swapping between them?
In addition to changing the Z order as NS17 showed you, you should also make the one you're not using disabled,
GetDlgItem (IDC_MYNEGLECTEDCONTROL)->EnableWindow (TRUE / FALSE) , or the user will end up selecting them using TAB - and they will be very puzzled why the things they are typing don't show up...
Iain.
|
|
|
|
|
prithaa wrote: How can I bring the list box on the foreground and send the edit box in the background?
call BringWindowToTop() for list box
|
|
|
|
|
are you still on about this. your best bet is to get the window sizes and adjust the edit box such that it doesnt overlap the listbox. am I gunna give you the code to do that ? no. GetWindowRect(), GetClientRect(), MapWindowPoints(), SetWindowPos(). Maybe in response to a WM_SIZE message.
|
|
|
|
|
the title says it all. i just want to show the text and disable the option that user can input some text in the rich edit box control
thanx
|
|
|
|
|
You can call SetReadOnly() API
- NS -
|
|
|
|
|
thanx. that did the trick
|
|
|
|
|
You are welcome...
- NS -
|
|
|
|
|
You can disable or read only your control(Richedit) with set these opition (disable or readonly) on the property window of control.
|
|
|
|
|
Does it need to be read-only all of the time? If so, do that in the resource file rather than at runtime via SetReadOnly() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How can I resize Rich Edit Box in the code? I already know the width and the height.
thanx
|
|
|
|
|
barbarini wrote: How can I resize Rich Edit Box in the code
Use MoveWindow or SetWindowPos
- NS -
|
|
|
|
|
I tried this:
void CTextView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
m_RichEdit.SetWindowPos(this, 0, 0, cx, cy, SWP_NOMOVE);
}
program will not start beacuse i get some message. I think the problem is in "this" in SetWindowPos. My base class is CFormView. Any ideas?
|
|
|
|
|
That may be due to the following reason.
m_RichEdit will not be subclassed when OnSize is called for the first time. This usually happens in the dialog based applications.
In your case, you can do as...
GetDlgItem( IDC_RICHEDIT )->SetWindowPos(this, 0, 0, cx, cy, SWP_NOMOVE);
Hope it will work...
- NS -
|
|
|
|
|
barbarini wrote: SetWindowPos(this, 0, 0, cx, cy, SWP_NOMOVE);
One thing i ignored...
Why are you passing the "this"? It is not needed. You can set it as NULL and modify it as ( 0, 0, 0, cx, cy, SWP_NOZORDER | SWP_NOMOVE )
- NS -
|
|
|
|
|
This is safe:
void CTextView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if (m_RichEdit.GetSafeHwnd())
m_RichEdit.MoveWindowPos(0, 0, cx, cy);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
cannot convert parameter 1 from 'struct HWND__ *' to 'const class CWnd *'
this is the message I get when I try your solution.
Grhhhhh.... This is driving my crazy......
|
|
|
|
|
I'm sorry - it was my mistake - I didn't delete the "Pos" when I changed the
SetWindowPos to MoveWindow
void CTextView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if (m_RichEdit.GetSafeHwnd())
m_RichEdit.MoveWindow(0, 0, cx, cy);
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
YES YES YES......
Many Thanx...... You saved the day......
|
|
|
|
|
Heh You're welcome. Sorry I added to the confusion/frustration!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
And in the continue with NS17 use of these functions on the WM_SIZE .
|
|
|
|
|
Hamid. wrote: use of these functions on the WM_SIZE.
What do u mean?WM_SIZE of which control?
|
|
|
|
|
For when he changes size of dialog.
|
|
|
|
|
Hamid. wrote: For when he changes size of dialog
But he didnt mention about changing the dialog size.
|
|
|
|
|
Naveen.R wrote: But he didnt mention about changing the dialog size
See the other branch of this thread...
- NS -
|
|
|
|