|
Dear all,
i want to resize my form on runtime whenever monitor resulation change.
forexample my application is running on 800*600 and then i change it on 1024*768 at this time i want to resize my controls. For this i try form's Resize event but it is not working.
i hve also read last discussion on forum in this regard.
so kindly tell me on what event and the short way to handle this problem.
thnks in advance.
farukhalifarooq
|
|
|
|
|
hi,
I faced same problem in my application. So i can tell you what you can do. See i tried a lot to achive this.But upto my level beast no point. It may possible for some gurus in codeproject but i am not sure.
In my application i wrote custom class to fix my resolution to 1024*768. I completed my application. Then i submitted this as a article in codeproject.com . But i didn't got excellent feedback. I got only above average feedback. So if you want then you can refer my article called "Dynamic Resolution Fixer".
this is that cool link.
http://www.codeproject.com/csharp/CSDynamicScrRes.asp
If you want to know more about the working style.Then you can contact through codeproject.com.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
thnx for reply.
i hve study ur article it tells u how u can forcefully retain a specific resulation but i dont want this.
acctually i want to allow user to change his resulation, and according to this i hve to adjust my controls.
so my question is still there
1- on changing monitor resulation which event of form fires?(its not Resize).
2- the shortest way to tackle this problem.
Regards,
farukh ali farooq
|
|
|
|
|
hi,
Ok. Did you rated my article ?. If it is not matching your criteria then not need. Actallu i have the same problem that you have. i tried a lot but i didn't got. but now i am little bit confident on this and will try my level best to give a nice solution for your problem.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
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.
|
|
|
|
|