-
July 19th, 2006, 10:09 AM
#1
Simple Edit Box problem, help!
I guess it is simple...
I have this edit box where i am trying to show a HUGE amount of text. The problem comes when you scroll the same edit box, the lines that is beeing scroolled become "overwrited".
How to avoid this? By Invalidate everytime someone scroll the editbox?
Please help.
Thanks.
Desva.
Caminante no hay camino, se hace camino al andar.
-
July 19th, 2006, 10:19 AM
#2
Re: Simple Edit Box problem, help!
Nope, I think this might be issue with Edit control.
What is text size in bytes ?
Regards,
Ramkrishna Pawar
-
July 19th, 2006, 10:33 AM
#3
Re: Simple Edit Box problem, help!
Hi there...
Thanks for the reply...
The actual size of the text i dont have idea, but is an entire A4 page full of text. And the edit box area is just half of the A4 size, so in order to check the rest of the text, you have to scroll. And the problem comes when u actually scroll. The text gets overwrited.
Any idea, hints, suggestion?
;-)
Thanks.
Desva.
Caminante no hay camino, se hace camino al andar.
-
July 19th, 2006, 10:39 AM
#4
Re: Simple Edit Box problem, help!
Thats weird, it's not that huge data, and I tried it here and dosent happen as you have described. Are you doing any event processing on that edit box ?
Regards,
Ramkrishna Pawar
-
July 19th, 2006, 10:52 AM
#5
Re: Simple Edit Box problem, help!
What i did is that to the editbox, i attached a variable CString m_text.
to this m_text i just did: m_text = " the hole text...."; where the hole text is the equivalente of a A4 page.
But when i scroll, it gets messed.
Can i send u the code?
Thanks.
Desva.
Caminante no hay camino, se hace camino al andar.
-
July 19th, 2006, 10:55 AM
#6
Re: Simple Edit Box problem, help!
Yeah, post it here.
Also can you try (make a copy of project) removing the CString member variable and use
Code:
SetWindowText(hWnd_Edit , szText);
Regards,
Ramkrishna Pawar
-
July 19th, 2006, 11:08 AM
#7
Re: Simple Edit Box problem, help!
Ok...
I have a dialog, on this dialog there is a EditBox to which a variable type CString is attached called m_text.
This m_text has a A4 long text. The EditBox is just half of a A4 therefore to read everything you need to scroll the area, but when doing this, the text gets overwrited.
I tried your last suggestion, check what happend:
Code:
error C2660: 'SetWindowTextA' : function does not take 2 parameters
I did
Code:
SetWindowText(IDC_terms , m_tt);
where IDC_terms is the name of the EditBox and m_tt is the name of the variable that is holding the entire A4 of text.
Thanks... but continue the same
:-D
Caminante no hay camino, se hace camino al andar.
-
July 19th, 2006, 01:30 PM
#8
Re: Simple Edit Box problem, help!
First parameter of ::SetWindowText() is the handle to the window( in your case it should be the handle to the Edit box) but you pass the Edit box ID which is different thing.
Anyway try this:
Code:
HWND hEdit = GetDlgItem(IDC_terms );
::SetWindowText(hEdit,"some text");
OR
Code:
SetDlgItemText(IDC_terms,"Some text");
Cheers
-
July 19th, 2006, 01:49 PM
#9
Re: Simple Edit Box problem, help!
you might wnat to consider using the MS TextBox control. you would have to add that to your project (activex controls).
-
July 19th, 2006, 02:11 PM
#10
-
July 19th, 2006, 11:47 PM
#11
Re: Simple Edit Box problem, help!
It's Better if you Simple go for a CRichEditCtrl instead of edit control.
Thanx
-
July 20th, 2006, 06:24 AM
#12
Re: Simple Edit Box problem, help!
It's Better if you Simple go for a CRichEditCtrl instead of edit control.
Thanks for the reply..
Can you give me more info about that option? The CRichEditCtrl ?
Thanks a lot.
Cheers.
Caminante no hay camino, se hace camino al andar.
-
July 20th, 2006, 06:34 AM
#13
Re: Simple Edit Box problem, help!
On CG there is n no of Article is Present on CRichEditCtrl just search Them Hopefully you Will Find Everything What ever you want.
if Still problem Please let us know
Thanx.
-
July 20th, 2006, 06:47 AM
#14
Re: Simple Edit Box problem, help!
Hi there...
Again, thanks for the reply.
I just checked that option and there is a little "big" problem.
I must give the address to load the file, right?
I cant, since it must be "hardwired" or the text, no matter if it is huge, must be in the code itself.
Have you checked the attached file?
Thanks...
cheers!
Desva.
Caminante no hay camino, se hace camino al andar.
-
July 20th, 2006, 06:59 AM
#15
Re: Simple Edit Box problem, help!
No i Didn't Checked your Code .But as i said in all case CRichEditCtrl has lots of advantage over CEdit .and you can check on code guru how to read a Complete File Content in CRichEdit Control .hope Some Article is also available on Google too. First Checked it out. and then Let us Know. I hope it's not Going to create any Problem for you.if still you have problem Please let us know.
Thanx
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
|