Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 22:14
Blake Coverett22-Sep-03 22:14 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira22-Sep-03 22:26
Andrew Shapira22-Sep-03 22:26 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 23:09
Blake Coverett22-Sep-03 23:09 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 23:20
Blake Coverett22-Sep-03 23:20 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 0:06
Andrew Shapira23-Sep-03 0:06 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett23-Sep-03 5:58
Blake Coverett23-Sep-03 5:58 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 9:12
Andrew Shapira23-Sep-03 9:12 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 0:01
Andrew Shapira23-Sep-03 0:01 
Ah. Well, thanks, I took a look. I don't know the Win API but it appears that the idea in the blog is to compute the difference between the vertical extents of the window and the client area, and use the difference to adjust the size of the window so that the client area comes out to be an integral number of text lines.

In the example I gave, getting the client area to be a desired size is not the problem. The desired vertical size of the client area is 110 pixels, and that is what the area is as measured with a screen dump. It appears that setting the ClientSize property of the rich text box to use a height of 110 does in fact set the client area to 110.

So I think the blog might be solving a different problem than what's needed here.

One problem I did notice is that the font's Font.Height value is given as 22 pixels, but the baseline-to-baseline spacing in the rich text box is 24 pixels. Does anyone know why this might be? It's certainly necessary to account for this in order to get an integral number of text lines. Maybe there is some Font or RichTextBox property that needs to be used besides Font.Height.
Generalnewbie trying to Pinvoke Pin
jpervaz22-Sep-03 17:33
jpervaz22-Sep-03 17:33 
GeneralRe: newbie trying to Pinvoke Pin
Blake Coverett22-Sep-03 17:51
Blake Coverett22-Sep-03 17:51 
GeneralRe: newbie trying to Pinvoke Pin
jpervaz23-Sep-03 3:40
jpervaz23-Sep-03 3:40 
GeneralRe: newbie trying to Pinvoke Pin
Blake Coverett23-Sep-03 6:10
Blake Coverett23-Sep-03 6:10 
Generalbuilding a canned email sender Pin
frank2122-Sep-03 14:05
frank2122-Sep-03 14:05 
GeneralRe: building a canned email sender Pin
fadee22-Sep-03 20:43
fadee22-Sep-03 20:43 
GeneralObjectStreams in .NET Pin
Anonymous22-Sep-03 13:18
Anonymous22-Sep-03 13:18 
GeneralRe: ObjectStreams in .NET Pin
J. Dunlap22-Sep-03 15:38
J. Dunlap22-Sep-03 15:38 
GeneralRe: From MFC to C# Serialization Pin
J. Dunlap22-Sep-03 10:54
J. Dunlap22-Sep-03 10:54 
GeneralBinding on Tab Controls Pin
Wjousts22-Sep-03 9:35
Wjousts22-Sep-03 9:35 
GeneralRe: Binding on Tab Controls Pin
Wjousts23-Sep-03 4:24
Wjousts23-Sep-03 4:24 
GeneralValidating a windows form Pin
Wjousts22-Sep-03 7:44
Wjousts22-Sep-03 7:44 
Generalcall unmanaged ActiveX method from C# Pin
rishikt22-Sep-03 6:16
rishikt22-Sep-03 6:16 
GeneralAccessing datasets on form Pin
phimix22-Sep-03 6:10
phimix22-Sep-03 6:10 
GeneralRe: Accessing datasets on form Pin
Mike Osbahr22-Sep-03 7:26
Mike Osbahr22-Sep-03 7:26 
GeneralRe: Accessing datasets on form Pin
phimix22-Sep-03 19:26
phimix22-Sep-03 19:26 
GeneralMultithreaded Apps Pin
Ricardo Moncada22-Sep-03 6:04
Ricardo Moncada22-Sep-03 6:04 

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.