473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

To Registry when closing a UserControl

I have a UserControl on a form.
The form is closing and I need the usercontrol to write to the Registry.

Where do I do that?

In the Disposed event? I need to do it when controls on the usercontrol are
still active so I can write, for example, the Text value of a Textbox.

In the Overrides Sub Dispose method? if so, before or after the
If disposing Then statement?

I've read Help and got only more confused.

Thanks


Nov 21 '05 #1
2 974
Just use the closing event of the form

Imports Microsoft.Win32

Dim reg As RegistryKey
reg = Registry.LocalMachine.OpenSubKey("Software\MyKey", True)
reg.SetValue("My Key", "My Value")
If Not (reg Is Nothing) Then reg.Close()

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #2
Not the form. I wish the UserControl had a closing event.

The question is about the UserControl doing it.

Thankls

"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:Oy**************@TK2MSFTNGP12.phx.gbl...
Just use the closing event of the form

Imports Microsoft.Win32

Dim reg As RegistryKey
reg = Registry.LocalMachine.OpenSubKey("Software\MyKey", True)
reg.SetValue("My Key", "My Value")
If Not (reg Is Nothing) Then reg.Close()

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mark A | last post by:
Here is the description of a new feature in 8.2.2 (FP9) from the InfoCenter: "DB2_SKIPINSERTED registry variable You can use the DB2_SKIPINSERTED registry variable to skip uncommitted inserted...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
5
by: Wysiwyg | last post by:
I'm new to c# programming and can't figure out how to avoid duplicating common code in multiple classes when I'm restricted to using different system base classes.. I'm using c# in asp.net to write...
1
by: Lars Skogshus | last post by:
I made a UserControl in VB.NET and uploaded it to the webserver, my problem is that the dll dont register in the registy at the client registry. I think it do How should i do? here is my code...
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
5
by: daniel.hedz | last post by:
I am generating a usercontrol dynamically successfully, but when I try to find that usercontrol I get a type mismatch. This is what I am doing: //Loading my usercontrol...
1
by: projectVBA | last post by:
Hi , I wrote some add in for PowerPoint and i'm trying to find an automatic way to load it every time PowerPoint starts. I found Microsoft Code example (see below ) BUT the problem is : I can't...
0
by: =?Utf-8?B?cmIyd2hyaWRlcg==?= | last post by:
While closing Windows XP I get a system not responding. In event manager says Windoss saved user registery while application or service was still using registry during log-off. The memory is not...
2
by: John Wright | last post by:
I need to put some registry entries in for my program so our helpdesk scanning software will pick it up. I need to put the following data in the registry: In the software classes hive under...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.