PC Review


Reply
Thread Tools Rate Thread

Conversion from VB to C#

 
 
Sakharam Phapale
Guest
Posts: n/a
 
      19th Nov 2004
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


 
Reply With Quote
 
 
 
 
Sakharam Phapale
Guest
Posts: n/a
 
      19th Nov 2004
Hi All,

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

Thanks and Regards,
Sakharam Phapale


"Sakharam Phapale" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Nov 2004
"Sakharam Phapale" <(E-Mail Removed)> schrieb:
> I am new in C#.
>
> Please tell me, how to convert following statements..


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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Yonas Hagos
Guest
Posts: n/a
 
      21st Nov 2004

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



"Sakharam Phapale" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from Access 97 to 2003 & get a "Conversion Errors" tabl eidinger2000 Microsoft Access 0 4th Feb 2010 04:19 PM
Conversion errors where no conversion needed jbeckh2@gmail.com Microsoft Dot NET Framework 0 12th Jan 2007 07:24 PM
VB Conversion Keywords And .NET Conversion Routines rawCoder Microsoft VB .NET 43 2nd Mar 2005 02:56 PM
VB Conversion Keywords And .NET Conversion Routines rawCoder Microsoft VB .NET 2 28th Feb 2005 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 AM.