By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,855 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,855 IT Pros & Developers. It's quick & easy.

Registry Help Needed

P: n/a
Hi All

I am writing a small app that enumerates a certain registry key & then adds
the key values to a listbox

When I select one in the listbox & click the delete button I want to delete
that item from the registry

Example:

Some Key In Registry:

SubKey1 Value = "Hello"
SubKey2 Value = "Bye"
SubKey3 Value = "Cheap"
SubKey4 Value = "Expensive"
SubKey5 Value = "LOL"

So, the values Hello, Bye, Cheap, Expensive & LOL are shown in the lisbox,
but I cannot delete a key according to that value as it don't exist. So, if
I clicked on CHEAP how do I delete the entire SubKey3 from the registry?

Any help would be wonderful

TIA
Apr 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jonny wrote:
Hi All

I am writing a small app that enumerates a certain registry key & then adds
the key values to a listbox

When I select one in the listbox & click the delete button I want to delete
that item from the registry

Example:

Some Key In Registry:

SubKey1 Value = "Hello"
SubKey2 Value = "Bye"
SubKey3 Value = "Cheap"
SubKey4 Value = "Expensive"
SubKey5 Value = "LOL"

So, the values Hello, Bye, Cheap, Expensive & LOL are shown in the lisbox,
but I cannot delete a key according to that value as it don't exist. So, if
I clicked on CHEAP how do I delete the entire SubKey3 from the registry?

Any help would be wonderful

TIA

You need to hold a reference to SubKey3 in the list of values. You have
a display member ( Cheap ) and a value member ( SubKey3 ), but you'll
have to bind the listbox to a table or arraylist or some such thing.
Then when Cheap is selected for deletion, you can then delete SubKey3.

Tom
Apr 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.