|
The control won't let you set the value outside the bounds.
You can catch the exception and ignore it, if you like, but that hardly serves any purpose, as the value still won't be set.
What is the reason that you want to set the value outside the bounds?
---
single minded; short sighted; long gone;
|
|
|
|
|
It is not my idea
But I was asked to do it.
Maybe there is the way to cancel the check of the bounds performed by the control, somehow ?
|
|
|
|
|
Nope. There's no way to get the value outside the bounds, unless you increase. the Max bound.
You'd have to create your own version of the control to get any additional functionality.
So, say you ARE successful at getting the value outside the bounds. Why 30? What is supposed to happen when the user types a value into the text box? What if he/she clicks on the Up and Down buttons? If the value supposed to shoot down into the valid range?
If you need some kind of flag denoted by the value 30, why not just replace that with a checkbox? If the box is checked, the numeric control gets disabled and a flag is set. If not, the numeric is re-enabled and the flag is reset.
|
|
|
|
|
I know, I know
All these thought were the first things that came to my mind when I've got this assignment, but for some reason they whant it to be done this way. Eventually, offcourse, we will do it as you are saying, but first I have to proove that it is not possible to impliment it the way they want
So, any ideas on the stated problem?
|
|
|
|
|
julgri wrote: but for some reason they whant it to be done this way.
Managers... can't live with 'em, can't shoot 'em.
|
|
|
|
|
Maybe I can unsubscribe from the eventhandler that checkes this Value? Is it possible? Just I do not know which event is handling this, but I have a feeling that I know the function, which handles this. Any ideas?
|
|
|
|
|
You never subscribed to one in the first place, so no, you can't unsubscribe from it. Also, this isn't done by an event handler. The check is done inside the Value, Minimum, and Maximum properties. No events are fired to trigger this check.
|
|
|
|
|
Are you sure? If it is so, than there is really no way around it. Good !
How do you know that? I could not find such a precise description anywhere.
|
|
|
|
|
Go get Lutz Roeder's .NET Reflector and look at the code in the NumericUpDown class yourself!
|
|
|
|
|
julgri wrote: Is there any way to do that?
You can inherit this class to realize this feature for derived class.
julgri wrote: I also need the Min and Max to be set, so the user knows the bounds.
How a user can understand the Min and Max when he CAN input more or less?
|
|
|
|
|
I want to convert a string to byte array as follows
<br />
byte[] b = Convert.FromBase64String(s);
it is giving the following error:
Invalid length for a Base-64 char array.
can any one give me a suggestion to solve this.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I guess you could use the Encoding class (System.Text).
Encoding encoding = Encoding.UTF8;
byte[] b = encoding.GetBytes(s);
But you have to use the right encoding.
Hope this helps.
|
|
|
|
|
For Conversion of String to Byte Array go like this,
public static byte[] StrToByteArray(string str)
{
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
return encoding.GetBytes(str);
}
Don't go with Base 64 because it is of invalid length.
Because of an unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Regards,
Satips.
|
|
|
|
|
Thank you, Thanks a lot.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Welcome
Regards,
Satips.
|
|
|
|
|
Satips wrote: For Conversion of String to Byte Array go like this,
public static byte[] StrToByteArray(string str)
{
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
return encoding.GetBytes(str);
}
Or simply:
byte[] data = System.Text.Encoding.ASCII.GetBytes(str);
---
single minded; short sighted; long gone;
|
|
|
|
|
Yes Guffa.
But if i give it Like that Jaya will ask how ? so i typed it as so simple format so that she can easily understand the concept.
Regards,
Satips.
|
|
|
|
|
M|2696|0|D|I|20070604-19:31:25.177|255|8=FIX.4.29=23235=D34=269649=Qa-QTIP-Sim-A56=Qa-QTIP-Sim-A-Internal52=20070604-23:31:2540=1MDSNAPID=6071=511=Q8BO7023-121=4955=QQQQ59=05011=12463/2007-06-04-07:3138=100109=RajTest5012=Raj9040=NSTRATEGY=PassThru54=147=A100=ARCA10=169|0|
how can i get value of any tag from it
like 100=ARCA
i want to get "ARCA" in a string how can i get it
pls help
Thanks in advance
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
do a string.Split and pass that Ctrl char (the square i see) and as the delimiter.
|
|
|
|
|
Here you go :
String fixString = "Whateever";<br />
string[] fixArray = fixString.Split(Convert.ToChar(1)); <br />
HashTable fixTable = new HashTable();<br />
string[] fieldArray = null;<br />
for (int fieldCount = 1; fieldCount < message.Length; fieldCount++)<br />
{<br />
fieldArray = fixArray[fieldCount].Split('=');<br />
fixTable.Add(fieldArray[0].ToString(), fieldArray[1].ToString()); <br />
}
Hope this helps.
by the way, I too used all this in my early carrier.
|
|
|
|
|
if i am able to do it like this
100=ARCA10=169|0|
using substring
now i have to get value of first tag
eg
100=
Result should be "ARCA"
i want it in seperate string
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
String fixString = "Whateever";<br />
string[] fixArray = fixString.Split(Convert.ToChar(1)); <br />
HashTable fixTable = new HashTable();<br />
string[] fieldArray = null;<br />
for (int fieldCount = 1; fieldCount < message.Length; fieldCount++)<br />
{<br />
fieldArray = fixArray[fieldCount].Split('=');<br />
fixTable.Add(fieldArray[0].ToString(), fieldArray[1].ToString()); <br />
}<br />
string firstTagString = fixTable["100"].ToString()
This will give you string which is there in tag 100, no matter at what position it is at.
I am telling you this because FIX is a tag based protocol and not a position based. The position may vary from message to message.
It is a more generalized solution for your scenario.
Success
|
|
|
|
|
you do message.Length
you mean fixString.Length here
Am i right
even than its crashing for my message
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
My Mistake
It should be fixArray
Here's your code
String fixString = "Whateever";<br />
string[] fixArray = fixString.Split(Convert.ToChar(1)); <br />
HashTable fixTable = new HashTable();<br />
string[] fieldArray = null;<br />
for (int fieldCount = 1; fieldCount < fixArray.Length; fieldCount++)<br />
{<br />
fieldArray = fixArray[fieldCount].Split('=');<br />
fixTable.Add(fieldArray[0].ToString(), fieldArray[1].ToString()); <br />
}<br />
string firstTagString = fixTable["100"].ToString()
|
|
|
|
|
its still giving index was outside the bounds of array
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|