How do i get my "About Dialog" to open when a linklabel is clicked on my form

How do i get my "About Dialog" to open when a linklabel is clicked on my form

ive looked thru the documentation with visual studio and its not very user friendly for newbies so maybe someone can help

basically i have a program ive made and i need a "About Program" box dialog to show when i click a link inside the program.

please let me know thankyou

Anthony,




Answer this question

How do i get my "About Dialog" to open when a linklabel is clicked on my form

  • Gess Man

    1. Use add new item and add an about box to the project

    2. Create a instance of the aboutbox1 form and show it using showdialog

    Code

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
    Dim x As New AboutBox1
    x.ShowDialog()
    End Sub

    3. When you run the code and click the button the aboutbox will show.


  • ClaudioCabral

     AnthonyUK wrote:

    How do i get my "About Dialog" to open when a linklabel is clicked on my form

    ive looked thru the documentation with visual studio and its not very user friendly for newbies so maybe someone can help

    basically i have a program ive made and i need a "About Program" box dialog to show when i click a link inside the program.

    please let me know thankyou

    Anthony,

     

    Anthony,

    I will assume you have inserted an "About Box" using the VB Form Wizard and this box is name "AboutBox.vb". The easiest way, although not a best practice is:

    1) In the design view of the application double-click the LinkLabel; this will bring you to the coding screen for the LinkLabel. In particular the LinkClicked event.

    2) Place the following code in the event:

    AboutBox.Show()

    3) Run program and test.

    If the form is named something other than "AboutBox.vb" then you will want to replace the "AboutBox" with the form name I.E.. form was named MyForm then the coding would be: MyForm.Show()

    A best practice would be to declare a new instance of the form and first Initialize, load then show it. However, while being fairly new to VB the above steps will accomplish what you would like. You will also find many detailed examples of opening forms in most teach-yourself VB.NET and VB 2005 books.

    I hope you find this helpful.

    Thank you,

    James


  • How do i get my "About Dialog" to open when a linklabel is clicked on my form