Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionChanging userControl properties run time?? Pin
Nafiseh Salmani6-Jun-06 22:42
Nafiseh Salmani6-Jun-06 22:42 
AnswerRe: Changing userControl run time?? [modified] Pin
Mairaaj Khan6-Jun-06 23:33
professionalMairaaj Khan6-Jun-06 23:33 
QuestionRe: Changing userControl run time?? [modified] Pin
Nafiseh Salmani7-Jun-06 0:31
Nafiseh Salmani7-Jun-06 0:31 
AnswerRe: Changing userControl run time?? [modified] Pin
Mairaaj Khan7-Jun-06 20:49
professionalMairaaj Khan7-Jun-06 20:49 
QuestionHandleCreated problem Pin
sianatia6-Jun-06 22:14
sianatia6-Jun-06 22:14 
AnswerRe: HandleCreated problem Pin
Mairaaj Khan6-Jun-06 23:27
professionalMairaaj Khan6-Jun-06 23:27 
QuestionXML encryption Pin
engsrini6-Jun-06 22:09
engsrini6-Jun-06 22:09 
QuestionRich Text Box Questions Pin
Peter Sbarski6-Jun-06 21:09
Peter Sbarski6-Jun-06 21:09 
I am working on an application with a rich text box and I am starting to go crazy.

Here’s what I need to do:

* Set the width of the text box to the width of the widest string.
* Get the height of the text box given a particular width so that all text fits in and there are no vertical or horizontal gaps (i.e. tightest configuration) and no scroll bars.
* Get the next narrowest/widest configuration of the text box which has one less or one more line.

I have tried using MeasureString (with GenericTypographic and GenericDefault), I have tried using SetMeasureableCharactersRanges, I have tried counting pixels, I have tried enabling anti-aliasing and smoothing text, I feel that I have tried everything.

Unfortunately it seems that when I measure strings and then use these measurements with the text box, they mismatch.

For example, my text measuring function tells me that the width of the longest word is 10. However, when I set the width of the text box to 10 it turns out to be too small.

To make it right I have to add a fudge factor. Unfortunately it seems that for different strings the amount that I need to add varies. Sometimes it can be 1, sometimes it can be 10.

I am aware of the issues between GDI and GDI+ but is there nothing one can do?

Any help/suggestions would be greatly appreciated.

Thanks.
AnswerRe: Rich Text Box Questions Pin
Mairaaj Khan6-Jun-06 21:50
professionalMairaaj Khan6-Jun-06 21:50 
QuestionUsing TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 20:45
cybersurferdev6-Jun-06 20:45 
AnswerRe: Using TripleDES Encryption [modified] Pin
stancrm6-Jun-06 21:21
stancrm6-Jun-06 21:21 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 21:38
cybersurferdev6-Jun-06 21:38 
AnswerRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani6-Jun-06 21:31
Kodanda Pani6-Jun-06 21:31 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 21:42
cybersurferdev6-Jun-06 21:42 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani6-Jun-06 22:10
Kodanda Pani6-Jun-06 22:10 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 22:49
cybersurferdev6-Jun-06 22:49 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:03
Kodanda Pani7-Jun-06 0:03 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev6-Jun-06 23:32
cybersurferdev6-Jun-06 23:32 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:04
Kodanda Pani7-Jun-06 0:04 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev7-Jun-06 0:10
cybersurferdev7-Jun-06 0:10 
GeneralRe: Using TripleDES Encryption [modified] Pin
Kodanda Pani7-Jun-06 0:20
Kodanda Pani7-Jun-06 0:20 
GeneralRe: Using TripleDES Encryption [modified] Pin
cybersurferdev7-Jun-06 1:45
cybersurferdev7-Jun-06 1:45 
AnswerRe: Using TripleDES Encryption [modified] Pin
leppie7-Jun-06 6:20
leppie7-Jun-06 6:20 
QuestionForm freezes on async webservice call Pin
Talal Sultan6-Jun-06 20:39
Talal Sultan6-Jun-06 20:39 
Questionhow to get the send items Pin
ayyp6-Jun-06 20:21
ayyp6-Jun-06 20:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.