Registry Help Needed

J

Jonny

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
 
T

tomb

Jonny said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top