Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I get an automatic scroll bar on a CEdit Control

Posted on 1997-12-09
6
Medium Priority
?
487 Views
Last Modified: 2013-11-20
I have a CEdit control in my application.  I want it to use
a vertical scroll bar only if necessary.  I was able to find
resources to turn the scroll bar on or off, but this was
independent of how much text was displayed.

I succeeded in getting this automatic scroll bar behavior by
using a CRichEditCtrl.  I set the vertical scroll bar on and
left the disable no scroll off.

Using the CRichEditCtrl seems like overkill for my
application.  Can I get this behavior with CEdit?
0
Comment
Question by:zelda071497
[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
  • 3
  • 3
6 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1311928
Yes, you can use myEdit->ModifyStyle(WS_VSCROLL, 0) to turn off the vertical scroll and myEdit->ModifyStyle(0, WS_VSCROLL) to turn it on.
0
 

Author Comment

by:zelda071497
ID: 1311929
This just turns the scroll bar on or off.  I am looking for something that will automatically turn it on or off depending on how must text is displayed in the control.

Using your suggestion,  I would have to catch an event every time the text was changed and see if the text still fits in the box.
Then I would have to add the scroll bar, if it no longer fit.

Can't this be done automatically, similar to the way the CRichEditCtrl handles this?


0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1311930
What other styles do you have in the edit control?
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

by:zelda071497
ID: 1311931
I have on: visible, tab stop, left align, multiline, no hid selection,
border, and read only.
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1311932
Do you have ES_AUTOVSCROLL?
0
 

Author Comment

by:zelda071497
ID: 1311933
I have tried ES_AUTOVSCROLL both on and off.  It makes no
difference.  The help for this attribute says:

In a multiline control, Auto VScroll automatically scrolls text up one line when the user presses ENTER on the last line. Type: Bool. Default: False.

So this does not solve my problem.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

688 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