Click here to Skip to main content
15,883,809 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: That Dammned Caret! Pin
Christian Graus25-Feb-07 9:40
protectorChristian Graus25-Feb-07 9:40 
GeneralRe: That Dammned Caret! Pin
Anybloodyid25-Feb-07 9:52
Anybloodyid25-Feb-07 9:52 
GeneralRe: That Dammned Caret! Pin
Christian Graus25-Feb-07 10:02
protectorChristian Graus25-Feb-07 10:02 
GeneralRe: That Dammned Caret! Pin
Anybloodyid25-Feb-07 11:22
Anybloodyid25-Feb-07 11:22 
AnswerRe: That Dammned Caret! Pin
TwoFaced25-Feb-07 10:06
TwoFaced25-Feb-07 10:06 
GeneralRe: That Dammned Caret! Pin
Anybloodyid25-Feb-07 11:27
Anybloodyid25-Feb-07 11:27 
QuestionRe: That Dammned Caret! Pin
Anybloodyid25-Feb-07 22:51
Anybloodyid25-Feb-07 22:51 
AnswerRe: That Dammned Caret! Pin
TwoFaced26-Feb-07 8:43
TwoFaced26-Feb-07 8:43 
Not that tall of an orderSmile | :) I am 99.99% sure I know what your after and the start I gave you will get you there. What I did was looked for a change in the selectionfont (aka. Where the caret is). If the caret goes from bold text to regular text the if statement will evaluate to true and the code inside will execute. All you need to do is look at the current font and update your controls as needed. Here is an example using your programs code
Dim m_LastFont As Font = Nothing
Private Sub rtbText_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtbText.SelectionChanged
    'Has font changed since last position?
    If m_LastFont Is Nothing OrElse Not m_LastFont.Equals(rtbText.SelectionFont) Then
    'Yes.  Update GUI to reflect it

        'Set last font to new font
        m_LastFont = rtbText.SelectionFont


        'If Bold button doesn't reflect current state change it
        If tlbBold.Checked <> m_LastFont.Bold Then
            tlbBold.Checked = m_LastFont.Bold
            Bold = m_LastFont.Bold
        End If

        'If Italic button doesn't reflect current state change it
        If tlbItalic.Checked <> m_LastFont.Italic Then
            tlbItalic.Checked = m_LastFont.Italic
            Italic = m_LastFont.Italic
        End If
    End If
End Sub
The font object has everything you need to know, except color, but the same principles can be applied there as well. I hope that clears things up. Assuming I understand what you want, which I think I do, this is your solution. Or at least the only one I could come up with Smile | :)
GeneralRe: That Dammned Caret! Pin
Anybloodyid26-Feb-07 12:06
Anybloodyid26-Feb-07 12:06 
GeneralRe: That Dammned Caret! Pin
TwoFaced26-Feb-07 13:23
TwoFaced26-Feb-07 13:23 
GeneralRe: That Dammned Caret! Pin
Anybloodyid26-Feb-07 22:02
Anybloodyid26-Feb-07 22:02 
GeneralRe: That Dammned Caret! Pin
TwoFaced27-Feb-07 9:02
TwoFaced27-Feb-07 9:02 
GeneralRe: That Dammned Caret! Pin
Anybloodyid27-Feb-07 21:49
Anybloodyid27-Feb-07 21:49 
GeneralRe: That Dammned Caret! Pin
TwoFaced28-Feb-07 8:46
TwoFaced28-Feb-07 8:46 
GeneralRe: That Dammned Caret! [modified] Pin
Anybloodyid28-Feb-07 11:31
Anybloodyid28-Feb-07 11:31 
QuestionVB.NET Printing Alignment??? Pin
harveyhanson25-Feb-07 9:10
harveyhanson25-Feb-07 9:10 
AnswerRe: VB.NET Printing Alignment??? Pin
Snews25-Feb-07 19:42
Snews25-Feb-07 19:42 
QuestionVB.NET 2005 Printing Help please Pin
harveyhanson25-Feb-07 7:37
harveyhanson25-Feb-07 7:37 
AnswerRe: VB.NET 2005 Printing Help please Pin
TwoFaced25-Feb-07 8:02
TwoFaced25-Feb-07 8:02 
GeneralRe: VB.NET 2005 Printing Help please Pin
harveyhanson25-Feb-07 8:21
harveyhanson25-Feb-07 8:21 
GeneralRe: VB.NET 2005 Printing Help please Pin
TwoFaced25-Feb-07 8:28
TwoFaced25-Feb-07 8:28 
GeneralRe: VB.NET 2005 Printing Help please [modified] Pin
harveyhanson25-Feb-07 8:34
harveyhanson25-Feb-07 8:34 
GeneralRe: VB.NET 2005 Printing Help please Pin
TwoFaced25-Feb-07 8:55
TwoFaced25-Feb-07 8:55 
GeneralRe: VB.NET 2005 Printing Help please Pin
harveyhanson25-Feb-07 9:09
harveyhanson25-Feb-07 9:09 
QuestionVS 2005 bindingsource using a complex filter Pin
steve_rm25-Feb-07 7:31
steve_rm25-Feb-07 7:31 

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.