|
For some reason, left, right, up, and down arrows aren't getting caught by OnKeyDown. Does anyone know what could be causing this problem?
-- Steve
|
|
|
|
|
hi,
P;)lease clarify little bit more. Which control and which evet.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
The OnKeyDown and OnKeyUp events don't catch the arrow keys. OnKeyPress catches the arrow keys.
It's an annnoying little workaround, the OnKeyDown/OnKeyUp catch the ASCII chars and the modifiers (Ctrl, Shift, Alt) but not the arrow keys and the OnKeyPress catches ASCII chars and arrows but not modifiers.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
how to create a menu that has a vertical text in the left side ?
thanks...
|
|
|
|
|
|
With the software I am writing, user input is coming in via custom controls ( physical ones ) plugged into the serial or parallel ports. Does anyone have any experience in watching those ports in C# ?
Thanks
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
You can't get to the ports directly uising C# alone. You need a .DLL file running in Ring 0 to do the port work for you and expose an interface that you can use in C#. Check out http://www.logix4u.net/[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm working on a UserControl which allows other controls to be drawn onto it (Much like a Panel or GroupBox control).
However, now I want to define the area in which controls can be placed and drawn (Called the client area, I think) - the TabControl control is a good example of this, controls can only be placed in the rectangle shown with the dashed line. How can I define this area in my own User Control?
Thanks
|
|
|
|
|
Sorry to bump this n'all... but seriously, no-one's done this before?
|
|
|
|
|
In theory, you might want to experiment with a Panel control to handle that for you. You'll probably have to handle the drag and drop for your control's client area and what your calling your client area (the Panel control) to make sure that objects of type System.Control get dropped on your area instead of anywhere in your control.
And no, I haven't done it before...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how do you check if an input string is numeric?
|
|
|
|
|
C# doesn't really have an IsNumeric function like VB had. Even though it's not the best idea to intentionally use the try/catch block for functional code, what I sent you yesterday will work.
try
{
O = UInt32.Parse( string_expression );
}
catch
{
}
if the string_expression is not in the correct format for a UInt32, it will throw an exception, which you can handle in the catch block. There are quite a few forum discussions on this, with some examples on how to implement a better IsNumeric function without using the try/catch block.
|
|
|
|
|
You can use Char.IsNumber to walk over the string looking for any bad input, you can use a textbox derived class that only accepts numbers, or you can use regular expressions. If
Regex.Replace(inputString, @"[-?][\d*][.?][\d?]", "").Length > 0
then you don't have a number. That's not tested, but it's close. It's looking for an optional -, digits, an optional . and optionally, more digits.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
private bool IsNumeric(object value)
{
try
{
double d = System.Double.Parse(value.ToString(), System.Globalization.NumberStyles.Any);
return true;
}
catch
{
return false;
}
}
if (IsNumeric(text1.Text)
string tempvalue = "This is a NUMERIC";
else
string tempvalue = "This is not a NUMERIC";
|
|
|
|
|
Hello,
i have a web service which verifies a signature of a client using CAPICOM.SignedData class. If i verify only the signature everthing is ok, but when i verify the certificates too, jumps the exception.
I do the same in the client side and there is no problem so i deduce that the problem is between CAPICOM and the webService.
I have had many prolems integrating CAPICOM in this project and one of them i solved it modifying the "username" attribute in the "proccesmodel" element in the machine.config file.
I know it would be better if i didn´t use CAPICOM, but it is compulsory for this project.
Thank you for your help and advise.
|
|
|
|
|
I have a question:
I can use reflection to view anything inside and object. But, I have a complex object that contains other objects and collections of other objects.
How can I use reflection to drill down into these contained objects?
I want to pass in the root object and reflect though the entire object graph and display the fields (and values) in a tree view.
Any ideas?
Tony
|
|
|
|
|
This has been done in Reflector, what you will want to do is load the assembly, from that call GetTypes() and iterate through each type. Within each type you will want to look at classes such as MethodInfo , ConstructorInfo , FieldInfo , etc. There are methods within the Type class that will return object arrays of these types.
- Nick Parker My Blog | My Articles
|
|
|
|
|
I would like to do this in the same code (not from an assembly). I certainly can use FieldInfo to see the root objects fields and data, but then I need to move into the contained object. Thats where I am stuck.
Type t = o.GetType();
FieldInfo[] fi = t.GetFields();
foreach (FieldInfo field in fi)
{
Console.WriteLine("Field: {0}\tType: {1}", field.Name, field.FieldType);
}
But, now....how to reflect into the "fields"?
Tony
|
|
|
|
|
|
GetValue returns an object reference. Then how to drill down into contained classes. I have had this questions too.
|
|
|
|
|
|
I've got a custom control which has quite a few properties, and they are all stuck under misc.
I'm sure i read somewhere that they could be set to their own, or an already existing titled section by using an attribute, but i can't find where i read it, or any attributes which look like they might do the job.
Can anyone help me?
Cheers
Cata
|
|
|
|
|
|
I'm trying to begin programming Managed Direct3D with C#.
But whatever I do it won't work.
Not even the sample projects wich come with the SDK won't run.
The error i get is the following:
An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.directx.direct3d.dll
Additional information: Object reference not set to an instance of an object.
It gives the error on the following statment:
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
If i catch the NullReferenceException and make the program continue as if everything is fine, then i get the message that the program was unable to create a device.
I have installed the managed framework and directx.
DirectDraw seems to work fine cause i can run the sample project wich is included with: Managed DirectX Tutorial Part 1 - The Title Screen (Managed Metroid)
I'm running Windows XP sp2 rc1 with the latest Managed DirectX SDK (summer 2004) and visual studio.net 2003
|
|
|
|
|
Do you have a 3d capable graphics card? I can run all (well most, some HLSL stuff doesnt work on my hardware ATI8500) the samples here.
top secret xacc-ide 0.0.1
|
|
|
|