Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 140259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:34:57+00:00 2026-05-11T07:34:57+00:00

On a windows mobile device I have a mutliline text edit control that is

  • 0

On a windows mobile device I have a mutliline text edit control that is set to read-only and has some static text displayed during it’s display lifetime. I would like to only display a vertical scrollbar when it’s actually useful (i.e. the text is larger than the display).

I can’t easily figure out if the text is to large to display because of two reasons.

  1. There is no horizontal scroll bar displayed so the text wraps.
  2. Under windows mobile, the win32 routines to calculate the size of what text will display does not work correctly. They return a incorrect rectangle.

The edit control must tell the scroll bar what it’s scroll range is at some point. I was wondering if I could get in between then and hide the scroll bar if it’s not going to be used.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:34:57+00:00Added an answer on May 11, 2026 at 7:34 am

    This is how I solved this problem.

    First off:

    • It only works with read-only mode of a edit control (as you don’t want the text to change often).
    • I think is specific to Windows Mobile MFC, big windows can handle this a lot better.
    • The solution is very very hacky.

    Solution:

    • I have a standard CEdit bound to the control.

      CEdit m_Message;

      DDX_Control(pDX, IDC_MESSAGE, m_Message);

    • During the InitDialog and OnSize calls, turn on the display of the scroll bar and setup a timer message.

      m_Message.ShowScrollBar(SB_VERT, TRUE);

      SetTimer(DO_ADJUST_DISPLAY_STATE, 50, 0);

    • In the timer handling code, use the scroll information to determine if the scroll bar needs to be displayed.

    • If not being displayed, turn off the scroll bar and force the window to redisplay.

     void CMessageDlg::OnTimer( UINT_PTR nIDEvent )   {     switch(nIDEvent)     {     case DO_ADJUST_DISPLAY_STATE:         KillTimer(nIDEvent);         // deselect all text         m_Message.SetSel(0, 0); 
            SCROLLINFO info;         m_Message.GetScrollInfo(SB_VERT, &info);          if(info.nPage > (UINT)info.nMax)         {             // need to re-display the non scroll bar version             m_Message.ShowScrollBar(SB_VERT, FALSE);              // I could not find any other way to force a redisplay              // correctly without display problems...              // first move the window to a know invisible area             // then wait (using a timer) for the window to move             // then move the window back to it's original position                  RECT rt;             rt.left = 0;             rt.right = 5;             rt.top = 0;             rt.bottom = 5;             m_Message.MoveWindow(&rt);              SetTimer(DO_REDISPLAY_MESSAGE, 50, 0);         }         break;      case DO_REDISPLAY_MESSAGE:         KillTimer(nIDEvent);         // m_MessagePosition holds the original position         // worked out dynamically during the WM_SIZE         // processing         m_Message.MoveWindow(&m_MessagePosition);         break;     } } 

    I hope that helps out other people who may have similar requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 94k
  • Answers 95k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer the simple thing , to create first the 2 tables,… May 11, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer Yes you can use the imports from the other file… May 11, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer You get several things wrong here. a HTML list item… May 11, 2026 at 6:55 pm

Related Questions

On a Windows Mobile 5.0 device I have an MFC C++ kiosk application that
I have a Windows CE device that we are deploying, but we have complete
I'm looking for a way to connect a Windows Mobile device to a PC
I'm going around in circles with regards to WCF and security, so I'm listing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.