CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Apr 2003
    Posts
    187

    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.

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    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

  3. #3
    Join Date
    Apr 2003
    Posts
    187

    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.

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    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

  5. #5
    Join Date
    Apr 2003
    Posts
    187

    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.

  6. #6
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    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

  7. #7
    Join Date
    Apr 2003
    Posts
    187

    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.

  8. #8
    Join Date
    May 2005
    Posts
    4,954

    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
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  9. #9
    Join Date
    Oct 1999
    Location
    ks
    Posts
    523

    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).

  10. #10
    Join Date
    Apr 2003
    Posts
    187

    Re: Simple Edit Box problem, help!

    Hi there!
    Thanks for the reply...
    I found the problem, but still not knowing how to solve it...
    I am using a SKIN, so everytime the editbox is scrolled the skin seems NOT to be redraw...
    I will upload the project so if anyone wants to give me a hand.

    In order to check the error, u must "de-select" de text on the edit box and just then scroll it. And this is something "interesting" since if the text in the edit box is selected and then u scroll, nothing happens, but if it is the way around, the error appears.

    Anyone knows why?

    Thanks again.
    Desva
    Attached Files Attached Files
    • File Type: rar t.rar (62.8 KB, 81 views)
    Caminante no hay camino, se hace camino al andar.

  11. #11
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: Simple Edit Box problem, help!

    It's Better if you Simple go for a CRichEditCtrl instead of edit control.

    Thanx

  12. #12
    Join Date
    Apr 2003
    Posts
    187

    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.

  13. #13
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    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.

  14. #14
    Join Date
    Apr 2003
    Posts
    187

    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.

  15. #15
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    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

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured