Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Toggle scrolling & wrapping of text

Posted on 2002-04-10
5
Medium Priority
?
254 Views
Last Modified: 2013-12-27
I'm creating an app using WCE and I'm trying to get the
display to toggle wrapping and scrolling of text.  

The scrollbar appears and disapears, but the text won't
redraw, it stays in its previous state.  

I'm reading the text currently displayed into a buffer,
change scrolling state, and then redraw text.

Any ideas??  Thanks!!

Here's my code:

void CTextViewerView::OnViewWrappedtowindow()
{
        CString RedrawTextBuffer;
     CEdit& theEdit = GetEditCtrl();
     
     //Read Text from window
     GetWindowText(RedrawTextBuffer);      
     LPTSTR p = RedrawTextBuffer.GetBuffer(65536);
     
     CWnd* pMain = AfxGetMainWnd();
     CMenu* menu_bar = pMain->GetMenu();
     CMenu* view_menu = menu_bar->GetSubMenu(2);

        //Change display of Window (Wrapping or Scrolling)
     if (WrapText)
     {                       //Add scrollbar
          ModifyStyle(0, ES_AUTOHSCROLL|WS_HSCROLL);
          view_menu->CheckMenuItem
(ID_VIEW_WRAPPEDTOWINDOW, MF_BYCOMMAND | MF_UNCHECKED);
          WrapText = 0;
     }
     else
     {                          //Do Word Wrap
          ModifyStyle(ES_AUTOHSCROLL|WS_HSCROLL, 0);
     
          view_menu->CheckMenuItem
(ID_VIEW_WRAPPEDTOWINDOW, MF_BYCOMMAND | MF_CHECKED);
          WrapText = 1;
     }

        //Reset text to new window
     theEdit.SetWindowText((LPCTSTR)p);

//Tried to add the following but doesn't help
/*     ShowWindow(SW_SHOW);
     pMain->UpdateWindow();

     OnUpdate(NULL, 0, NULL);
*/
}
0
Comment
Question by:bfeller2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 200 total points
ID: 6932722
theEdit.Invalidate();
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
A short article about problems I had with the new location API and permissions in Marshmallow
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question