Click here to Skip to main content
15,891,943 members
Home / Discussions / C#
   

C#

 
GeneralRe: Splitting a string Pin
Philip Fitzsimons26-Aug-03 2:29
Philip Fitzsimons26-Aug-03 2:29 
GeneralRe: Splitting a string Pin
Donald_a26-Aug-03 6:26
Donald_a26-Aug-03 6:26 
GeneralGet a grahics object from a Bitmap Pin
Ista25-Aug-03 17:22
Ista25-Aug-03 17:22 
GeneralRe: Get a grahics object from a Bitmap Pin
Nick Parker25-Aug-03 17:37
protectorNick Parker25-Aug-03 17:37 
GeneralRe: Get a grahics object from a Bitmap Pin
Ista25-Aug-03 17:41
Ista25-Aug-03 17:41 
GeneralRe: Get a grahics object from a Bitmap Pin
Nick Parker25-Aug-03 17:46
protectorNick Parker25-Aug-03 17:46 
GeneralRe: Get a grahics object from a Bitmap Pin
Ista25-Aug-03 17:47
Ista25-Aug-03 17:47 
GeneralRe: Get a grahics object from a Bitmap Pin
Nick Parker25-Aug-03 18:27
protectorNick Parker25-Aug-03 18:27 
GeneralRe: Get a grahics object from a Bitmap Pin
Ista25-Aug-03 18:28
Ista25-Aug-03 18:28 
GeneralDES encryption/decryption Pin
devvvy25-Aug-03 16:41
devvvy25-Aug-03 16:41 
GeneralRe: DES encryption/decryption Pin
Julian Bucknall [MSFT]26-Aug-03 5:46
Julian Bucknall [MSFT]26-Aug-03 5:46 
QuestionValid CodeProject Article? Pin
Steven Behnke25-Aug-03 14:41
Steven Behnke25-Aug-03 14:41 
AnswerRe: Valid CodeProject Article? Pin
Ista25-Aug-03 15:13
Ista25-Aug-03 15:13 
GeneralRegistry Errors Pin
mikemilano25-Aug-03 10:57
mikemilano25-Aug-03 10:57 
GeneralRe: Registry Errors Pin
Roger Stewart25-Aug-03 12:02
professionalRoger Stewart25-Aug-03 12:02 
GeneralRe: Registry Errors Pin
mikemilano25-Aug-03 12:57
mikemilano25-Aug-03 12:57 
GeneralRe: Registry Errors Pin
Roger Stewart25-Aug-03 15:11
professionalRoger Stewart25-Aug-03 15:11 
Sorry for the late reply.

Since you know the keys/subkeys that you want to open, try and open/create them all at once. This gets rid of the multiple CreateSubKey/OpenSubKey statements which may be part of the problem.

I was able to get a small example working, that I hope will help you. Create a new C# Windows Application and place 2 buttons (btnRead and btnWrite), one label (label1) on the form. Add the Click events for the two buttons using the Designer Property Grid. Replace the generated Click events with the following code:
<code>
		private void btnRead_Click(object sender, System.EventArgs e)
		{
			RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey(@"Software\SC\Param");
			if ( softwareKey != null )
			{
				int x = (int)softwareKey.GetValue("IHDetailIDWidth", 50); // <-- problem line    
				label1.Text = x.ToString();
			}  
		}

		private void btnWrite_Click(object sender, System.EventArgs e)
		{
			RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey(@"Software\SC\Param", true);  
			softwareKey.SetValue("IHDetailIDWidth",this.Width); // <- problem line
		}
</code>




Roger Stewart
"I Owe, I Owe, it's off to work I go..."

GeneralRe: Registry Errors Pin
mikemilano26-Aug-03 7:06
mikemilano26-Aug-03 7:06 
GeneralScreenshot of Window... Pin
Calamitous25-Aug-03 10:40
Calamitous25-Aug-03 10:40 
Questionhow to retrieve a list of sheet from excel with odbc in c#? Pin
zoltix25-Aug-03 10:15
zoltix25-Aug-03 10:15 
AnswerRe: how to retrieve a list of sheet from excel with odbc in c#? Pin
Csharp™25-Aug-03 11:43
Csharp™25-Aug-03 11:43 
GeneralRe: how to retrieve a list of sheet from excel with odbc in c#? Pin
zoltix25-Aug-03 22:47
zoltix25-Aug-03 22:47 
GeneralDataGridTextBoxColumn.WidthChange to trigger method Pin
mikemilano25-Aug-03 6:49
mikemilano25-Aug-03 6:49 
GeneralRe: DataGridTextBoxColumn.WidthChange to trigger method Pin
Roger Stewart25-Aug-03 7:25
professionalRoger Stewart25-Aug-03 7:25 
GeneralRe: DataGridTextBoxColumn.WidthChange to trigger method Pin
mikemilano25-Aug-03 7:48
mikemilano25-Aug-03 7:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.