-
Nov 8th, 2013, 09:27 AM
#1
Thread Starter
Hyperactive Member
Need help choosing the right control
Hi guys, i am trying to make a program which stores selected programs by user selection, and it will later store them in a database. What control would be best suited to list these programs? The user will need to select many items. I was going to use a listbox but its really limited, as you cant use tickboxes or anything like that on it. I don't want to waste time playing with this, so what control would be best recommended to achieve this?
I also need to be able to get more items from the registry about the installed programs, such as; address to each programs .exe location, and each programs icon. But I am unsure of the best location to get them or where to start with this. Here is what I got so far...
Code:
Private Sub SrcAppsBtn_Click(sender As Object, e As EventArgs) Handles SrcAppsBtn.Click
ListBoxPrograms.Items.Clear()
Dim regkey, subkey As Microsoft.Win32.RegistryKey
Dim value As String
Dim regpath As String = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
regkey = My.Computer.Registry.LocalMachine.OpenSubKey(regpath)
Dim subkeys() As String = regkey.GetSubKeyNames
Dim includes As Boolean
For Each subk As String In subkeys
subkey = regkey.OpenSubKey(subk)
value = subkey.GetValue("DisplayName", "")
If value <> "" Then
includes = True
If value.IndexOf("Hotfix") <> -1 Then includes = False
If value.IndexOf("Security Update") <> -1 Then includes = False
If value.IndexOf("Update for") <> -1 Then includes = False
If includes = True Then ListBoxPrograms.Items.Add(value)
End If
Next
End Sub
-
Nov 8th, 2013, 09:39 AM
#2
Re: Need help choosing the right control
A datatable bound to a datagridview sounds right. It sounds like you have potentially several columns worth of data, one of which might be a checkbox. The DGV can handle all of that, and a datatable to a database is pretty straightforward.
My usual boring signature: Nothing
-
Nov 8th, 2013, 02:15 PM
#3
Thread Starter
Hyperactive Member
Re: Need help choosing the right control
Thanks Shaggy..
Anyone else got anything else to get me started with this???
-
Nov 8th, 2013, 06:00 PM
#4
Re: Need help choosing the right control
If you don't want to do that (use a DGV+DataTable, despite it being pretty nice), you can either use a ListView, or the really nice ObjectListView (it's on SoureForge).
-
Nov 8th, 2013, 06:38 PM
#5
Re: Need help choosing the right control
ListView
-
Nov 9th, 2013, 09:40 AM
#6
Thread Starter
Hyperactive Member
Re: Need help choosing the right control
So now i got the right controls to use. now how can i get each installed programs location and its .exe path from the registry? i see "DisplayIcon" in the registry path above, maybe i can use that to get the icon location. But i still don't know how to find the programs launch file in the registry. Can anyone help me with this or is there an easier way to do it?
-
Nov 9th, 2013, 02:05 PM
#7
Thread Starter
Hyperactive Member
Re: Need help choosing the right control
-
Nov 9th, 2013, 10:00 PM
#8
Re: Need help choosing the right control
now how can i get each installed programs location
See this
-
Nov 10th, 2013, 10:40 AM
#9
Thread Starter
Hyperactive Member
Re: Need help choosing the right control
Thanks man, it's not quite what I was looking for, but its a pointer in the right direction though.
-
Nov 10th, 2013, 11:42 AM
#10
Lively Member
Re: Need help choosing the right control
use classic controls from telerik , or there are many others choices search google
-
Nov 10th, 2013, 12:12 PM
#11
Thread Starter
Hyperactive Member
Re: Need help choosing the right control
Binarybot, thanks for the suggestion, but its kinda expensive right now.
Originally Posted by Mucker
Code:
Private Sub SrcAppsBtn_Click(sender As Object, e As EventArgs) Handles SrcAppsBtn.Click
ListBoxPrograms.Items.Clear()
Dim regkey, subkey As Microsoft.Win32.RegistryKey
Dim value As String
Dim regpath As String = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
regkey = My.Computer.Registry.LocalMachine.OpenSubKey(regpath)
Dim subkeys() As String = regkey.GetSubKeyNames
Dim includes As Boolean
For Each subk As String In subkeys
subkey = regkey.OpenSubKey(subk)
value = subkey.GetValue("DisplayName", "")
If value <> "" Then
includes = True
If value.IndexOf("Hotfix") <> -1 Then includes = False
If value.IndexOf("Security Update") <> -1 Then includes = False
If value.IndexOf("Update for") <> -1 Then includes = False
If includes = True Then ListBoxPrograms.Items.Add(value)
End If
Next
End Sub
Haven not worked with datagridview and binding sources before, i am a little lost as in how to or which control i should populate. If i populate the bindingsource, it should update the datagridview automatically. Right? if so, can someone show me how to alter my code to do that or point me to a decent tut?
thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|