Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-03-2009
Member
 
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
Reply With Quote
  #2  
Old 18-03-2009
Member
 
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
Reply With Quote
  #3  
Old 18-03-2009
Member
 
Join Date: May 2008
Posts: 2,008
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
Reply With Quote
  #4  
Old 18-03-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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
Reply With Quote
  #5  
Old 18-03-2009
Member
 
Join Date: May 2008
Posts: 2,293
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem Customizing Visual Basic.Net"
Thread Thread Starter Forum Replies Last Post
Problem in Ms Access In Visual Basic Kushan Software Development 3 19-03-2009 02:31 PM
what are Visual Basic IDE? Naresh Modi Software Development 2 06-03-2009 09:49 AM
Is GUI same like Visual Basic ? Caesar Software Development 2 02-03-2009 01:32 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM
Visual Basic on LAN djbbenn Software Development 2 05-08-2008 02:15 PM


All times are GMT +5.5. The time now is 02:37 AM.