Options Form Example
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
8 posts
Page 1 of 1
What are we going to learn now?
I am going to show you how-to make options form like the one you see below with all functions (Expect saving settings, loading...)
This is what we will end up to:
First of to begin, you need 1 list box and couple panels (3).
Name the list box as
Add whatever controls you want to add them.
Copy and Paste this explained text into your project (I'm not sure if you need to change your form name as frmOptions)
I also have 2 buttons:
Heres the source code for what you see on the image above.
Source (WinRar required):
I am going to show you how-to make options form like the one you see below with all functions (Expect saving settings, loading...)
This is what we will end up to:
First of to begin, you need 1 list box and couple panels (3).
Name the list box as
Code: Select all
For panels, you don't need to name them. Just add tag for each panel, like General, Updates, User-Interface.lstSettings
Add whatever controls you want to add them.
Copy and Paste this explained text into your project (I'm not sure if you need to change your form name as frmOptions)
Code: Select all
Public Class frmOptions
Private Sub frmOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' // Select the first item
lstSettings.SetSelected(0, True)
End Sub
Private Sub lstSettings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSettings.SelectedIndexChanged
' // Our functions are in that sub
ChangeSettingsPanel()
End Sub
Public Sub ChangeSettingsPanel()
' // Scan all items
For i = 0 To Me.Controls.Count - 1
' // Less writing
With Me.Controls
' // We don't want items that has no tag
' // We have given our panels a tag through properties
If .Item(i).Tag = "" Then
Else
' // If the tag isn't empty, then check if the list box has selecteditem text
' // same as the panel tag
If lstSettings.SelectedItem = .Item(i).Tag Then
' // Then set the properties to show it and also don't forget to
' // edit the size
' // Location
.Item(i).Location = New Point(146, 12)
' // Size
.Item(i).Size = New Size(323, 290)
' // And last, show the panel
.Item(i).Show()
Else
' // If the panel tag isn't lstSettings selectedItem then
' // Hide it, no need to resize.
.Item(i).Hide()
End If
End If
End With
Next
End Sub
Private Sub btnSaveSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveSettings.Click
' // Save settings through My.Settings or to a textfile.
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
' // Close without saving settings
Me.Close()
End Sub
End Class
I also have 2 buttons:
Code: Select all
That should be it, for me, it works like a charm. If the no panel tagged as lstSettings SelectedItem then the form will look quite empty, so double check your items and panel's tags btnCancel
btnSaveSettings
Heres the source code for what you see on the image above.
Source (WinRar required):
You do not have the required permissions to view the files attached to this post.
Thanks for sharing Machard

or you gonna post a update too?
Dummy1912

or you gonna post a update too?
Dummy1912
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Dummy1912 wrote:Thanks for sharing Machard
or you gonna post a update too?
Dummy1912
Update? May I ask for what?
if you made any change's or something 
thats what i mean with a update.
Just a question not a request
Dummy1912

thats what i mean with a update.
Just a question not a request

Dummy1912
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Nice tutorial. I'll use it for one of my apps.
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
Can you explain what this does, because I don't really like just copy and paste, and this looks handy. So can you explain the code for each event/function, and what it does?
GoodGuy17 wrote:Can you explain what this does, because I don't really like just copy and paste, and this looks handy. So can you explain the code for each event/function, and what it does?
Just download and examine the source, how could I explain it more...
You have different sections for settings, like general settings... (then you put there like, Launc when Window Starts checkbox, and so on...) That should explain little bit
Download and examine
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023