|
-
September 12th, 1999, 02:34 AM
#1
Scrollable window in the dialog based app.
In the dialogbased aplication i want a window to dipplay certain textlines
Now i have displayed the lines But,
How can i get keys or mouse click in the window ?
OR more specifically window is to behave like a Scrolable view where user can read text and
move up-down if contents are larger ot fit in the window.
What i have done is
(i can display text on certain event )
//CWind wind ; is defined in the .h file
BOOL CMyDlg::OnInitDialog()
{
.
.
.
wind.CreateEx(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
className, NULL, WS_VISIBLE | WS_CHILD,
rect.left, rect.top, rect.right, rect.bottom,
this->GetSafeHwnd(), (HMENU) 100, NULL);
wind.ShowWindow(SW_SHOW);
CRect rcRight;
wind.GetClientRect(rcRight);
CDC *pDC;
pDC = wind.GetDC();
pDC->TextOut(rcRight.left, rcRight.top, "HELLO", 5);
...
}
Thanks
SoftBug
-
September 12th, 1999, 07:27 AM
#2
Re: Scrollable window in the dialog based app.
Hi softbug,
what u can do is Add a Text Box which is read only
in your application Dialog Box , and set the the text box properties to have a vertical scroll bar
Sam
-
September 15th, 1999, 10:33 PM
#3
Re: Scrollable window in the dialog based app.
Hi,
Thanks for your help;
But will you tell me exactly what should i do?
Cause, i have tried it by pasting the read-only editor from the resources.
It didn't work. it simply skips the extra lines if i used TextOut function.
Means i don't get the VScrol.
I have used following code display the text in the edit box.
May be something is wrong with that.
I want the text lines to be display at certain pos. in the window. these lines are records from a file
.
.
.
CRect rect();
CWnd *pWnd = GetDlgItem(IDC_MYEDIT);
pWnd->GetClientRect(rect);
CDC *pDC;
pDC = pWnd->GetDC();
pDC->TextOut(...);
.
.
.
Thanks
SoftBug
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|