Click here to Skip to main content
15,906,816 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to open my application by Active X ? Pin
Dave Kreskowiak25-Apr-06 1:37
mveDave Kreskowiak25-Apr-06 1:37 
QuestionProblems with GetCaretPos API function Pin
Husam Burhan23-Apr-06 18:31
Husam Burhan23-Apr-06 18:31 
AnswerRe: Problems with GetCaretPos API function Pin
Dave Kreskowiak24-Apr-06 5:43
mveDave Kreskowiak24-Apr-06 5:43 
QuestionRe: Problems with GetCaretPos API function Pin
Husam Burhan24-Apr-06 9:12
Husam Burhan24-Apr-06 9:12 
AnswerRe: Problems with GetCaretPos API function Pin
Dave Kreskowiak24-Apr-06 11:35
mveDave Kreskowiak24-Apr-06 11:35 
QuestionHow to set the the form owner to an application? Pin
cylix200023-Apr-06 17:31
cylix200023-Apr-06 17:31 
AnswerRe: How to set the the form owner to an application? Pin
Dave Kreskowiak24-Apr-06 5:29
mveDave Kreskowiak24-Apr-06 5:29 
QuestionHow to change the bold style for the text selection which consist of two or more font styles Pin
Chatura Dilan23-Apr-06 16:35
Chatura Dilan23-Apr-06 16:35 
Here is an example which I found on MSDN.

Private Sub ToggleBold()<br />
   If Not richTextBox1.SelectionFont Is Nothing Then<br />
      Dim currentFont As System.Drawing.Font = richTextBox1.SelectionFont<br />
      Dim newFontStyle As System.Drawing.FontStyle<br />
<br />
      If richTextBox1.SelectionFont.Bold = True Then<br />
         newFontStyle = FontStyle.Regular<br />
      Else<br />
         newFontStyle = FontStyle.Bold<br />
      End If<br />
<br />
      richTextBox1.SelectionFont = New Font(currentFont.FontFamily,currentFont.Size, newFontStyle )<br />
   End If<br />
End sub


With this code, I can change the current font bold style setting for the text selection of the RichTextBox
But the problem is,
If the selected text consists of two or more font styles, it doesn’t work.

Example :
Say that my selected text is
I am going to somewhere

You can see my sentence is consist of two font styles, When I select the whole sentence and try to change the current font bold style setting for it by using above code, it does not work

I think the problem occurs hereConfused | :confused:

richTextBox1.SelectionFont = New Font(currentFont.FontFamily, ……..

Dose anyone know how to correct it


Regards,


Chatura Dilan


AnswerRe: How to change the bold style for the text selection which consist of two or more font styles Pin
Dave Kreskowiak24-Apr-06 5:34
mveDave Kreskowiak24-Apr-06 5:34 
GeneralRe: How to change the bold style for the text selection which consist of two or more font styles Pin
Chatura Dilan24-Apr-06 15:03
Chatura Dilan24-Apr-06 15:03 
QuestionNeed help with Public Property Timer() Pin
Jirikub23-Apr-06 15:30
Jirikub23-Apr-06 15:30 
AnswerRe: Need help with Public Property Timer() Pin
Steve Pullan23-Apr-06 15:51
Steve Pullan23-Apr-06 15:51 
GeneralRe: Need help with Public Property Timer() Pin
Jirikub24-Apr-06 4:47
Jirikub24-Apr-06 4:47 
GeneralRe: Need help with Public Property Timer() Pin
Dave Kreskowiak24-Apr-06 5:27
mveDave Kreskowiak24-Apr-06 5:27 
GeneralRe: Need help with Public Property Timer() Pin
Jirikub24-Apr-06 5:42
Jirikub24-Apr-06 5:42 
GeneralRe: Need help with Public Property Timer() Pin
Dave Kreskowiak24-Apr-06 5:53
mveDave Kreskowiak24-Apr-06 5:53 
GeneralRe: Need help with Public Property Timer() Pin
Jirikub25-Apr-06 5:31
Jirikub25-Apr-06 5:31 
QuestionHow to play music files in vb.net applications? Pin
KaKa'23-Apr-06 15:29
KaKa'23-Apr-06 15:29 
AnswerRe: How to play music files in vb.net applications? Pin
Yuvi Panda23-Apr-06 20:46
Yuvi Panda23-Apr-06 20:46 
QuestionTable Adapters Pin
lupa-nikki23-Apr-06 12:17
lupa-nikki23-Apr-06 12:17 
QuestionCall Java Code From VB.net ? Pin
ALQallaf23-Apr-06 11:48
ALQallaf23-Apr-06 11:48 
AnswerRe: Call Java Code From VB.net ? Pin
Dave Kreskowiak23-Apr-06 13:43
mveDave Kreskowiak23-Apr-06 13:43 
GeneralRe: Call Java Code From VB.net ? Pin
Christian Graus23-Apr-06 19:32
protectorChristian Graus23-Apr-06 19:32 
AnswerRe: Call Java Code From VB.net ? Pin
Yuvi Panda23-Apr-06 20:48
Yuvi Panda23-Apr-06 20:48 
GeneralRe: Call Java Code From VB.net ? Pin
ALQallaf24-Apr-06 4:26
ALQallaf24-Apr-06 4:26 

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.