Click here to Skip to main content
16,006,013 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# Move/Resize Objects Pin
elapid5-Apr-05 17:37
elapid5-Apr-05 17:37 
GeneralHow do I obtain the current mouse position? Pin
elapid5-Apr-05 18:19
elapid5-Apr-05 18:19 
GeneralRe: How do I obtain the current mouse position? Pin
Ashok Dhamija5-Apr-05 18:57
Ashok Dhamija5-Apr-05 18:57 
QuestionHow to set the height of text lines? Pin
welsrping5-Apr-05 15:24
welsrping5-Apr-05 15:24 
AnswerRe: How to set the height of text lines? Pin
Ashok Dhamija5-Apr-05 18:47
Ashok Dhamija5-Apr-05 18:47 
GeneralRe: How to set the height of text lines? Pin
welsrping5-Apr-05 20:40
welsrping5-Apr-05 20:40 
GeneralRe: How to set the height of text lines? Pin
leppie5-Apr-05 23:24
leppie5-Apr-05 23:24 
GeneralRe: How to set the height of text lines? Pin
Ashok Dhamija5-Apr-05 23:26
Ashok Dhamija5-Apr-05 23:26 
In fact, the code cited by me works if you want to show text on some form or some other controls. However, in a RichTextBox, it will not work directly because display of text is managed internally. I personally checked the above method to draw the text on the face of a form by overriding the "OnPaint" and by giving "x" different values of say 50 or 100. It worked perfectly alright.

Now coming back to RichTextBox, I may mention that in the MFC days, in VC++ we had the Rich Edit Control classes, including CRichEditView class which in its 2.0 and 3.0 versions exposed a structure called "PARAFORMAT2 Structure", the contents of which can be seen at the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditstructures/paraformat2.asp[^]

I am just reproducing the basic structure of this structure for ready reference:

typedef struct _paraformat { 
    UINT cbSize; 
    DWORD dwMask; 
    WORD  wNumbering; 
    WORD  wEffects; 
    LONG  dxStartIndent; 
    LONG  dxRightIndent; 
    LONG  dxOffset; 
    WORD  wAlignment; 
    SHORT cTabCount; 
    LONG  rgxTabs[MAX_TAB_STOPS]; 
    LONG  dySpaceBefore; 
    LONG  dySpaceAfter; 
    LONG  dyLineSpacing; 
    SHORT sStyle; 
    BYTE  bLineSpacingRule; 
    BYTE  bOutlineLevel; 
    WORD  wShadingWeight; 
    WORD  wShadingStyle;
    WORD  wNumberingStart; 
    WORD  wNumberingStyle; 
    WORD  wNumberingTab; 
    WORD  wBorderSpace; 
    WORD  wBorderWidth; 
    WORD  wBorders; 
} PARAFORMAT2; 
#define  wEffects  wReserved


You can notice that one of the members is "dyLineSpacing" which was used in CRichEditView in MFC for changing line spacing as decided by the value of the other member-variable "bLineSpacingRule".

However, it appears that the aforesaid "PARAFORMAT2" is not exposed in the RichTextBox control in the .NET framework, though to be fair, I admit that I did not search its features exhaustively.

One possible solution could be to locate the previous Rich Edit Control's dll (riched20.dll or any later version) on the system and add a reference in your project and then use the said "PARAFORMAT2" structure. Or alternatively, please try to read the detaild literature in MSDN on RichEditBox in .NET if such a functionality is directly made available.
GeneralRe: How to set the height of text lines? Pin
welsrping6-Apr-05 14:41
welsrping6-Apr-05 14:41 
GeneralChange working directory Pin
.Sai.5-Apr-05 14:45
.Sai.5-Apr-05 14:45 
GeneralRe: Change working directory Pin
Dave Kreskowiak5-Apr-05 16:49
mveDave Kreskowiak5-Apr-05 16:49 
Generalaccess db with listView Pin
{cellardoor}5-Apr-05 13:53
{cellardoor}5-Apr-05 13:53 
GeneralRe: access db with listView Pin
Luis Alonso Ramos5-Apr-05 19:47
Luis Alonso Ramos5-Apr-05 19:47 
GeneralRe: access db with listView Pin
{cellardoor}6-Apr-05 8:28
{cellardoor}6-Apr-05 8:28 
GeneralRe: access db with listView Pin
Luis Alonso Ramos6-Apr-05 8:46
Luis Alonso Ramos6-Apr-05 8:46 
GeneralInconsistent: CRC32 (C#) vs. CRC32 (VB6) Pin
Phil@SP5-Apr-05 11:55
Phil@SP5-Apr-05 11:55 
GeneralRe: Inconsistent: CRC32 (C#) vs. CRC32 (VB6) Pin
Christian Graus5-Apr-05 13:10
protectorChristian Graus5-Apr-05 13:10 
GeneralAccessing WebService over SSL Pin
Anand Chida5-Apr-05 8:59
Anand Chida5-Apr-05 8:59 
GeneralRe: Accessing WebService over SSL Pin
CBone123428-Apr-05 5:27
CBone123428-Apr-05 5:27 
GeneralC# Speech Recognition. Pin
Anonymous5-Apr-05 8:11
Anonymous5-Apr-05 8:11 
GeneralWarning! This is an Ad! Pin
Dave Kreskowiak5-Apr-05 10:53
mveDave Kreskowiak5-Apr-05 10:53 
Generaldelay(windows application form) Pin
cishi_us5-Apr-05 8:05
cishi_us5-Apr-05 8:05 
GeneralRe: delay(windows application form) Pin
yoaz5-Apr-05 9:51
yoaz5-Apr-05 9:51 
GeneralRe: delay(windows application form) Pin
cishi_us6-Apr-05 0:09
cishi_us6-Apr-05 0:09 
GeneralRe: delay(windows application form) Pin
Sebastian Schneider6-Apr-05 0:43
Sebastian Schneider6-Apr-05 0:43 

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.