none
how to create login form

    Question

  • dear sir
    my project include login  form .it in side available serial key and activation key .when i insert
    serial key and  activation key i want to start my second form .but when i close my second form (fully application).
    after when i  restart my application i want to start without my logging form. please help me.
    thank you
    wansa

    'loging form
    
    
     If sm.CheckKey(key) Then
                MessageBox.Show("Activation was successful")
                If My.Settings.Setting = False Then
                    settings.Save()
                    Form2.Show()
                    Me.Close()
                End If
            Else
                MessageBox.Show("Activation was unsuccessful")
            End If
        End Sub
    End Class
    
    
    
    'second form
    
    Public Class Form2
        Dim settings As New My.MySettings
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If My.Settings.Setting = False Then
                settings.Save()
                Form1.Close()
            End If
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            End
        End Sub
    End Class


    Tuesday, April 18, 2017 3:42 PM

All replies

  • dear sir

    actually i want to one time activation method.

    thank you

    wansa

     

    Tuesday, April 18, 2017 4:17 PM
  • You would check which form is the startup form in MyApplication_Starup event.

    http://stackoverflow.com/questions/2271836/programmatically-change-the-startup-form-on-application-launch

    You create the event under project properties, Application Tab, "View Application events"


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, April 18, 2017 7:24 PM
    Moderator
  • dear madam

    I try your solution but not work

    thanks

    wansa

    Wednesday, April 19, 2017 4:24 AM
  • dear madam

    I try your solution but not work

    thanks

    wansa

    Well that doesn't tell me anything. Care to elaborate?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, April 19, 2017 9:48 AM
    Moderator