Conversion from VB to C#

  • Thread starter Thread starter Sakharam Phapale
  • Start date Start date
S

Sakharam Phapale

Hi All,

I am new in C#.

Please tell me, how to convert following statements..

Dim fOld As Font = myRichTextBox.SelectionFont

Dim fStyle As FontStyle = fOld.Style + (IIf(fOld.Bold, FontStyle.Bold * -1,
FontStyle.Bold))

myRichTextBox.SelectionFont = New Font(fOld.FontFamily, fOld.Size, fStyle)



Thanks and Regards,

Sakharam Phapale
 
Hi All,

By using VB, I forgot about Bitwise operators.
I got them now.

Thanks and Regards,
Sakharam Phapale
 
Try this.

Font fOld = myRichTextBox.SelectionFont;
FontStyle fStyle;
fStyle = fOld.Style + (IIf(fOld.Bold, (FontStyle.Bold * -1),
FontStyle.Bold));
myRichTextBox.SelectionFont = new Font(fOld.FontFamily, fOld.Size, fStyle);


Yonas
 
Back
Top