Post: [C#] NumericUpDown Help.
03-09-2013, 06:55 PM #1
KCxFTW
Who’s Jim Erased?
(adsbygoogle = window.adsbygoogle || []).push({}); Hello, I'm sort of new to C# programming and I'm having trouble getting the value in a NumericUpDown to work in a function. (Sorry if that doesn't make sense)

Here's what I'm having trouble with:
You must login or register to view this content.
I have the default value as 72, I was wondering how you could take any value in there and put it in a function with out using if statements.

I'm trying to make a Real Time Editing program, this is the thread that iMCSx started about it: You must login or register to view this content.

Sorry if I'm not explaining this very well.
03-28-2013, 03:51 PM #2
BuC-ShoTz
TeamMvKâ?¢
Originally posted by KCxFTW View Post
Hello, I'm sort of new to C# programming and I'm having trouble getting the value in a NumericUpDown to work in a function. (Sorry if that doesn't make sense)

Here's what I'm having trouble with:
You must login or register to view this content.
I have the default value as 72, I was wondering how you could take any value in there and put it in a function with out using if statements.

I'm trying to make a Real Time Editing program, this is the thread that iMCSx started about it: You must login or register to view this content.

Sorry if I'm not explaining this very well.

You must login or register to view this content.
    
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
byte[] value = BitConverter.GetBytes(Convert.ToInt32(numericUpDown1.Value)); // int32 = 4 bytes
Array.Reverse(value); //BIG ENDIAN
snresult = PS3TMAPI.ProcessSetMemory(target, PS3TMAPI.UnitType.PPU, procId,
0xFFFFFFFF, address, value);
}

TO NGU ADMINS:
whats wrong with the CODE TAG?
widen it and turn off word wrap?
Last edited by BuC-ShoTz ; 03-28-2013 at 04:16 PM.
03-28-2013, 09:26 PM #3
KCxFTW
Who’s Jim Erased?
Originally posted by ShoTz View Post
You must login or register to view this content.
    
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
byte[] value = BitConverter.GetBytes(Convert.ToInt32(numericUpDown1.Value)); // int32 = 4 bytes
Array.Reverse(value); //BIG ENDIAN
snresult = PS3TMAPI.ProcessSetMemory(target, PS3TMAPI.UnitType.PPU, procId,
0xFFFFFFFF, address, value);
}

TO NGU ADMINS:
whats wrong with the CODE TAG?
widen it and turn off word wrap?


Thank you so much! Instead of 72 = 00 00 00 48, how would I make it equal to 42 90 00 00? (float)
03-29-2013, 03:20 AM #4
BuC-ShoTz
TeamMvKâ?¢
Originally posted by KCxFTW View Post
Thank you so much! Instead of 72 = 00 00 00 48, how would I make it equal to 42 90 00 00? (float)


use this instead:
    
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
byte[] value = BitConverter.GetBytes((float)numericUpDown1.Value);
Array.Reverse(value); //BIG ENDIAN
snresult = PS3TMAPI.ProcessSetMemory(target, PS3TMAPI.UnitType.PPU, procId, 0xFFFFFFFF, address, value);
}
Last edited by BuC-ShoTz ; 03-29-2013 at 03:22 AM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo