Results 1 to 5 of 5

Thread: Problem Customizing Visual Basic.Net

  1. #1
    Join Date
    Nov 2008
    Posts
    85

    Problem Customizing Visual Basic.Net

    hi there

    I am having a small query regarding the vb.net As i am not a programmer in visual basic.net, i jsut want to know as how can i customize dialog box in this programming language.

    Please provide your opinion regarding this

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Problem Customizing Visual Basic.Net

    Most Windows applications request for user input. Dialog boxes are one means of requesting users for specific kinds of inputs. Therefore, VB.NET allows its designers to create a number of different types of dialog boxes. Standard Dialog boxes are included in classes that fall within the purview of the CommonDialog.

    1. FileDialog
    2. ColorDialog
    3. FontDialog
    4. PageSetupDialot
    5. PrintDialog

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Problem Customizing Visual Basic.Net

    Code:
    Public Class CustomDialog
            Private Sub CustomDialog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                Me.AcceptButton = Button1
                Me.CancelButton = Button2
                Me.TextBox1.Text = ""
            End Sub
            Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                Me.DialogResult = Windows.Forms.DialogResult.OK
                Me.Close()
            End Sub
            Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
                Me.Close()
            End Sub
        End Class

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Problem Customizing Visual Basic.Net

    In a new project which already has a form Form1, add another form and name it as FixeDialog.
    Set the Text property of this form as “Add Text”.
    Add a label control, a text box control and two command buttons.
    Change the text property of the label to “Enter Your Text!” and name the first button OK and the other as Cancel.
    In the property sheet of the form set the FormBorderStyle property to FixedDialog
    Set the ControlBox property as false. This is done to remove minimize, maximize and close buttons.

    Code:
    Public Class Form1
            Dim DialogBox As New CustomDialog()
            Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            End Sub
            Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                If DialogBox.ShowDialog = Windows.Forms.DialogResult.OK Then
                    Me.Label1.Text = DialogBox.TextBox1.Text
                End If
            End Sub
            Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
                Me.Close()
            End Sub
        End Class

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Problem Customizing Visual Basic.Net

    Create a new Visual Basic Windows Applications project in the Visual Studio IDE . To the form Form1 add a ColorDialogBox. Add two Buttons and name them

    Now in the code behind form add the following codes:
    Code:
    Public Class Form1 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
    Me.ColorDialog1.ShowDialog() 
    Label1.ForeColor = Me.ColorDialog1.Color 
    End Sub 
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 
    Me.Close() 
    End Sub 
    End Class

Similar Threads

  1. Problem in Ms Access In Visual Basic
    By Kushan in forum Software Development
    Replies: 3
    Last Post: 19-03-2009, 02:31 PM
  2. what are Visual Basic IDE?
    By Naresh Modi in forum Software Development
    Replies: 2
    Last Post: 06-03-2009, 09:49 AM
  3. Is GUI same like Visual Basic ?
    By Caesar in forum Software Development
    Replies: 2
    Last Post: 02-03-2009, 01:32 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Visual Basic on LAN
    By djbbenn in forum Software Development
    Replies: 2
    Last Post: 05-08-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,856,617.05665 seconds with 16 queries