VB .NET

VB .NET

Slip20

Q.1) . Write a VB.NET program to do the following operations on RichTextBox values 

 i) Font Style 
 ii) Font Color 
 iii) Save 
 iv) Open .  
[Marks 20] 

Solution

Public Class Slip20

    Dim s As New SaveFileDialog

    Dim fname As String

    Dim f As New FontDialog

    Dim c As New ColorDialog

    Dim op As New OpenFileDialog

    Private Sub FontStyleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontStyleToolStripMenuItem.Click

        If f.ShowDialog() = Windows.Forms.DialogResult.OK Then

            RichTextBox1.Font = f.Font

        End If

    End Sub


    Private Sub FontColorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontColorToolStripMenuItem.Click

        If c.ShowDialog() = Windows.Forms.DialogResult.OK Then

            RichTextBox1.ForeColor = c.Color

        End If

    End Sub


    Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click

        If s.ShowDialog = Windows.Forms.DialogResult.OK Then

            fname = s.FileName

        End If

    End Sub


    Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click

        If op.ShowDialog = Windows.Forms.DialogResult.OK Then

            op.OpenFile()

        End If

    End Sub

End Class

BCA Pratical Solution

My name is Vivek And I from Mumbai and Complete my Graduation Bca.my Age is 23 Years.

Post a Comment

Previous Post Next Post