Link to home
Start Free TrialLog in
Avatar of trovatore
trovatore

asked on

Want Rich Textbox ctrl, from resource, variable size

I have an application with a dialog box with an embedded
Microsoft Rich Textbox Control, which is used to display
to the user formatted information produced by the application.
As the application generates all the text, the control
is disabled, therefore scroll bars don't work.

The problem is that the amount of text we want to
put in the control varies widely, and we have to
make the control big enough to accomodate the
maximum, which makes the thing look pretty silly
when it winds up being the minimum.

Is there some way I can make a dialog box (including
the embedded Rich Textbox control) resize gracefully?
It's created from a resource.  Or, is there a way
to make scrollbars work in a disabled Rich Textbox
control?

ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trovatore
trovatore

ASKER

Um, yeah (though actually it's not called SetReadOnly(),
it's called SetLocked()).  The problem is (and I had
to go back and figure out what the problem was) we don't
really want the user to be able to highlight text in
the box.  The reason is that if he can, it creates a
reasonable expectation that he should be able to copy just
part of the text, and we don't support that, because
we implement a custom copy into both CF_TEXT and CF_RTF
formats, with special formatting, and it would be more
trouble than it's worth to figure out how to do that for
just a piece of the text.
Hmm ... only way I could imagine is that you could catch
the messages which are responsible for selection or, if
possible, you try to get notifications of the control
regarding the selection. In both cases you should be
able to simply de-select anything selected.
So it's possible that Zoppo's comment would have led to a solution if I'd pursued it, but I don't believe I was able to figure out how to do so--it's been so long that I can't be sure.  I don't want to say that no value was provided, but I don't think it solved the problem, so I suppose that's "no correct answer", to the nearest approximation.  I guess I'm requesting the question be deleted.
On second thought, maybe I did use it.  I'll give Zoppo the benefit of the doubt.
hm ... well, at least the question 'Or, is there a way
to make scrollbars work in a disabled Rich Textbox
control?' was perfectly answered with my comment.

anyway, you're welcome ...

have a nice day,

regards,

ZOPPO