Hi again DaniWeb, this time I'd like you to help me with the text alignment options available in a standard text editing application. My problem is, even though I got the application to successfully align the text where I want it, that if I click on every single option (Justify Left, Justify Center, Justify Right), the next time I want to click one, I'll have to double click it in order to make it work. Here's my code. Hope you understand what I'm trying to say. Thank you in advance.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ToolStripButton14.Checked = True
Private Sub ToolStripButton14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton14.Click
If ToolStripButton14.Checked = True Then
ToolStripButton15.Checked = False
ToolStripButton16.Checked = False
RichTextBox1.SelectionAlignment = HorizontalAlignment.Left
ToolStripButton14.CheckOnClick = False
ElseIf ToolStripButton14.Checked = False Then
ToolStripButton14.CheckOnClick = True
End If
End Sub
Private Sub ToolStripButton15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton15.Click
If ToolStripButton15.Checked = True Then
ToolStripButton14.Checked = False
ToolStripButton16.Checked = False
RichTextBox1.SelectionAlignment = HorizontalAlignment.Center
ToolStripButton15.CheckOnClick = False
ElseIf ToolStripButton15.Checked = False Then
ToolStripButton15.CheckOnClick = True
End If
End Sub
Private Sub ToolStripButton16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton16.Click
If ToolStripButton16.Checked = True Then
ToolStripButton14.Checked = False
ToolStripButton15.Checked = False
RichTextBox1.SelectionAlignment = HorizontalAlignment.Right
ToolStripButton16.CheckOnClick = False
ElseIf ToolStripButton16.Checked = False Then
ToolStripButton16.CheckOnClick = True
End If
End Sub
As you can notice, when the form loads the default alignment option is applied (left). If you don't understand what I want to do, please tell me so I can explain it better to you. Nevertheless, I don't think I can explain it better.