Conversion from VB to C#

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
 
S

Sakharam Phapale

Hi All,

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

Thanks and Regards,
Sakharam Phapale
 
H

Herfried K. Wagner [MVP]

Sakharam Phapale said:
I am new in C#.

Please tell me, how to convert following statements..

=> microsoft.public.dotnet.languages.csharp...
 
Y

Yonas Hagos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top