Now with this tutorial you could make it to anything you want. But I will be showing you how to allow Members to add custom stuff in your projects.
Now lately ive seen people with Link apps, I personally don't see how it would be helpful for myself, but I will show you how to allow your members to add their own link, and have it saved.
We start off with a design like this
Step 1
Double Click
My Project on the right in the
Solution Explorer.
Click Settings and add 3 settings named Link1, Link2, Link3, Name1, Name2, Name3.
Step 2
Go back to your project, and right below
Public Class Form1 put
Code:
Dim Settings As New My.MySettings
This will allow it so that we can use the word Settings instead of My.MySettings.
Next put the following code in Form1 Load sub
Code:
Button1.Text = Settings.Name1
Button2.Text = Settings.Name2
Button3.Text = Settings.Name3
Should look like this
Step 3
Now we need to add the links, so for each button click it and add this.
Button1
Code:
If Settings.Link1 = "http://" Then
Else
System.Diagnostics.Process.Start(Settings.Link1)
End If
Button2
Code:
If Settings.Link2 = "http://" Then
Else
System.Diagnostics.Process.Start(Settings.Link2)
End If
Button3
Code:
If Settings.Link3 = "http://" Then
Else
System.Diagnostics.Process.Start(Settings.Link3)
End If
Step 4
Now we need to add an extra form, go to Project > Add Windows Forms > Add.
Make the second form look something like this.
Step 5
Ok, So now click the form itself and put the following code below Public Class Form2
Code:
Dim settings As New My.MySettings
Then go to Form2 Load sub, and put the following code in it
Code:
TextBox1.Text = settings.Name1
TextBox2.Text = settings.Name2
TextBox3.Text = settings.Name3
TextBox4.Text = settings.Link1
TextBox5.Text = settings.Link2
TextBox6.Text = settings.Link3
Step 6
Click the Save button, and put this code in it.
Code:
settings.Name1 = TextBox1.Text
settings.Name2 = TextBox2.Text
settings.Name3 = TextBox3.Text
settings.Link1 = TextBox4.Text
settings.Link2 = TextBox5.Text
settings.Link3 = TextBox6.Text
settings.Save()
End
Should look like this
Step 7
Now go back to form1, and click the button "Set Custom Links"and in it put the code
Done
Now your done. I have not found a solution to refreshing the settings on a separate form, I have a solution that could be timers, but it wont be pretty for the programs process. When you open the program back up it will be saved.