how to make a vb program register form - vb.net

How do i make a vb program register form? like you can in steam, google, Xbox live? Register on one computer and login from another Computer? For Free? Is i could like in drop box etc? I am making a game launcher program and i want to have theme sync there stuff. I Googled it no help! The only way i know how to is a offline account. It is annoying me. I am not that good in vb.net programming. Thanks!
here is my code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.sli Then
Main.show()
End If
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked Then
My.Settings.sli = 1
Else
My.Settings.sli = 0
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
My.Settings.user = TextBox3.Text
My.Settings.pass = TextBox4.Text
My.Settings.Save()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If My.Settings.user = TextBox1.Text And TextBox2.Text = My.Settings.pass Then
Main.Show()
Else
MsgBox("Username Or Password Wrong! Try Again!")
End If
End Sub
End Class
Thanks!

Related

How can I toggle fullscreen for the embedded VLC player

I am embedding the VLC media player into a Windows Forms application through an activeX control.
The code goes like this:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Open file button
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.Title = "Open file"
If openFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
AxVLCPlugin21.playlist.add(openFileDialog1.FileName)
End If
openFileDialog1.Dispose()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'Play button
AxVLCPlugin21.playlist.play()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Stop button
AxVLCPlugin21.playlist.stop()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Pause button
AxVLCPlugin21.playlist.togglePause()
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
'Volume control
AxVLCPlugin21.audio.Volume = TrackBar1.Value
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
'Toggle Full Screen button
AxVLCPlugin21.video.toggleFullscreen()
End Sub
End Class
How can I toggle full screen?
This code makes no effect:
AxVLCPlugin21.video.toggleFullscreen()
Thank you.
if (axVLCPlugin21.video.fullscreen)
axVLCPlugin21.video.fullscreen = false;
else
axVLCPlugin21.video.fullscreen = true;

how do i save time in datagridview in vb.net 2010 [Newbie student]

Example i press start time and the time connected in textbox that it will show when i start the time same with out time,and when i press save it wont add to datagridview. Please help me with my problem. This is my save code:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Table1BindingSource.AddNew()
Me.Validate()
Me.Table1BindingSource.EndEdit()
Me.Table1TableAdapter.Update(Me.OpenDataSet.Table1)
End Sub
Ok, I solved your problem....
Here is how your form should look like :
And now you need to add the "Time" columns to the datagridview:
And now... follow my steps through the image:
and here is the code :
Public Class Form1
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Table1BindingSource.Rows.Add()
Table1BindingSource.Rows(Table1BindingSource.Rows.Count - 1).Cells(0).Value = TextBox1.Text & Table1BindingSource.Rows.Count
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CountTimer.Tick
TextBox1.Text += 1
End Sub
End Class
I Hope My Answer Was Useful To You :)

Show Form2 7seconds delayed after Form1 close

I have two forms in my application, form2 is shown on clicking a button in the form1. but i need a delay of 7 seconds between form1's close and form2's show for that i wrote the following code:
Public Class Form1
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
i = 0
Me.Close()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i += 1
If i = 7 Then
Form1.Show()
End If
End Sub
End Class
But it does not give me the result. form2 not shown at all. what was the mistake i had made in the code? can anyone help me?
Thanks in advance.
When there's no active form left in a Windows Forms application, the application will quit. Therefore, you might want to hide the main form instead of closing it:
Me.Hide()
i think no need of unnecessary declaration for time delay because you can simply set it on your timer control itself
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 7000
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Form2.Show()
Me.Close()
End Sub
End Class
or
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 7000
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Close()
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Form2.Show()
End Sub

VB.net Form unexpectingly terminating

Hi I have the following form but cant figureout why its upbrubtly terminiating when difrent buttons are clicked?
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub button1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter
Dim TEST1 As Integer = System.IO.Directory.GetFiles("C:\test\test").Length
If TEST1 = 0 Then
Me.WebBrowser1.Navigate("http://www.hotmail.com")
End If
End Sub
Private Sub button1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
Me.WebBrowser1.Navigate("http://WWW.facebook.com")
End Sub
Private Sub button2_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.MouseLeave
Me.WebBrowser1.Navigate("http://WWW.facebook.com")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.WebBrowser1.Navigate("file://C:\test\test")
Button1.Enabled = False
Button2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.WebBrowser1.Navigate("file://C:\test")
Button2.Enabled = False
Button1.Enabled = True
End Sub
Private Sub button2_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.MouseEnter
Dim TEST2 As Integer = System.IO.Directory.GetFiles("C:\test\test").Length
If TEST2 = 0 Then
Me.WebBrowser1.Navigate("http://www.hotmail.com")
End If
End Sub
The terms face book and hotmail are just random to keep company site private :)
I suspect the Mouse_Enter event and the Mouse_Leave events are not giving time to the webbrowser to fully load the document and maybe it is internally crashing.
Try checking if the webbrowser has finished working before navigating again and tell us:
Use
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Me.WebBrowser1.Navigate("http://www.google.com")
End if

how to close all forms?

log.vb
Public Class log
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "bassam" And TextBox2.Text = "bassam" Then
Me.Hide()
msgbox1.Show()
Else
Me.Dispose()
End If
End Sub
End Class
msbox1.vb
Public Class msgbox1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class
In the form msgbox1, I want to close the form log when i press Button1, but it just closes the msgbox1. How can I close all the forms?
If you want to close the whole application just call Application.Exit().