viernes, 9 de septiembre de 2016

BARRA DE ESTADO Y ZOOM EN .NET

BARRA DE ESTADO

Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
        dirty = True
        Dim contp As Integer
        Dim pal As String
        For i = 1 To RichTextBox1.Text.Length
            pal = (Mid(RichTextBox1.Text, i, 1))
            If pal = " " Then
                contp = contp + 1
            End If
        Next
        ToolStripStatusLabel3.Text = contp + 1
    End Sub

ZOOM

Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
        If TrackBar1.Value = 1 Then
            RichTextBox1.ZoomFactor = 1
        ElseIf TrackBar1.Value = 2 Then
            RichTextBox1.ZoomFactor = 2
        ElseIf TrackBar1.Value = 3 Then
            RichTextBox1.ZoomFactor = 3
        ElseIf TrackBar1.Value = 4 Then
            RichTextBox1.ZoomFactor = 4
        ElseIf TrackBar1.Value = 5 Then
            RichTextBox1.ZoomFactor = 5
        ElseIf TrackBar1.Value = 6 Then
            RichTextBox1.ZoomFactor = 6
        ElseIf TrackBar1.Value = 7 Then
            RichTextBox1.ZoomFactor = 7
        ElseIf TrackBar1.Value = 8 Then
            RichTextBox1.ZoomFactor = 8
        ElseIf TrackBar1.Value = 9 Then
            RichTextBox1.ZoomFactor = 9
        ElseIf TrackBar1.Value = 10 Then
            RichTextBox1.ZoomFactor = 10
        End If
    End Sub

0 comentarios:

Publicar un comentario