|
In a web app, you need to handle keypress events and write the code to do whatever you want. In javascript.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Various Windows application uses Shortcuts Keys.
How they implemented?
For example Cyberlink PowerDVD : Please see it.
here u will find numerous shortcuts.
I want like this.
Please help me.
Thank You.
Dipak
|
|
|
|
|
Hello,
Willibert has already answered your question in a very nice way. However if you do not want to use ProcessCmdKey, in that case you may simply set KeyPreview property of Form to true and then use KeyPress event of Form to trap keys, and call any method as per need.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi.....all's
I am begineer in c# ( today i am going to start work upon it )
can any one told me any good book of c# ( good book mense which language should be easy to understand )
Or any sample website from where i can read it.
Regard's
Kaushik
|
|
|
|
|
|
That depends on your background - do you know C/C++ - then your biggest problem will be to learn the .net library. If you are new to programming than you will first have to get a clue concerning more basic stuff like if-statements, loops etc.
Just take a walk/link to some (online)bookseller and have a look for C# - you will find a lot of books ranging from beginners books to medium difficulty.
|
|
|
|
|
Y_Kaushik wrote: good book of c#
Professional C# (Wrox Press)
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Y_Kaushik wrote: any sample website from where i can read it
You found one, here, codeproject
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi there,
i converted a font to string like this :
string data = this.Font.ToString();
and write in a text file.
now when i read it, i want to assign it to the form.
so i tried to convert it like this :
this.Font = (Font)data;
but its giving error,
someone know how can i do this?
Becoming Programmer...
|
|
|
|
|
You can't cast string to font but you can create font from string if you use appropriate constructor of string class and pass the correct data.
|
|
|
|
|
but how?
Becoming Programmer...
|
|
|
|
|
|
i know those constructors, i asked how to set directly from string, i know i can do this by split that line but i thought its not a good way and C# would have another way(short way) to do that....
thanks
Becoming Programmer...
|
|
|
|
|
I don't think there is another way rather than the constructor.
|
|
|
|
|
Hello,
You will have to pre-process the data read from file.
Like if the data in file is "[Font: Name=Georgia, Size=8.25, Units=3, GdiCharSet=0, GdiVerticalFont=False]", you will have to do something like:
this.Font= new Font(data.substring(11,18),....)=new Font("Georgia", 8.25, 3, 0, False)
Also, do have a look at the overloaded constructors, they will help you in pre-processing the data.
Hope that helps!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
i think split function will work better....anyway thanks
Becoming Programmer...
|
|
|
|
|
xmen_xwk wrote: its giving error
Like what? That doesn't really help when you fail to be somewhat verbose.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
my friend, leave this topic, i solved my problem by saving font in string in my own format, then split when required
Becoming Programmer...
|
|
|
|
|
Glad you got it work
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Dear all,
can anybody tell me how to get sql server version here..
Thanks in advance..
T@SU
|
|
|
|
|
Run the following SQL Query:
SELECT @@VERSION;
This will give you a result similar to this:
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on Windows NT 5.0 (Build 2195: Service Pack 4) <br />
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Thanks for your answer .. now i want
DigiOz Multimedia wrote: 2000
to retrive server year.. as sql 2000 or sql 2005
more pricisly i want to know wheather it is 2000 or 2005 so what is the simple way to do..
Thanks alot..
T@SU
|
|
|
|
|
If you want to do it via SQL have a look at the SERVERPROPERTY('ProductVersion') on MSDN. It wont give you '2000' or '2005' but the major.minor build which you should be able to use to work out the version installed. i.e. 9.x = 2005.
Another way is to use the registry if you want to go down that route but again i believe that will not give you 2000 or 2005 but a major.minor version number.
|
|
|
|
|
SqlCommand cmd = new SqlCommand(@"SELECT @@VERSION", conn);
SqlDataReader myReader = cmd.ExecuteReader()
Console.WriteLine(myReader[0]);
above lines are giving me exact version but they are in the form of string like "
Microsoft sql server 2000 ...."
so i will it be proper to split above string and get 2000 from array[3]
or anyother way can be done here....
T@SU
|
|
|
|
|
I think you should be doing...
SqlCommand cmd = new SqlCommand(@"SELECT SERVERPROPERTY('ProductVersion')", conn);
SqlDataReader myReader = cmd.ExecuteReader()
Console.WriteLine(myReader[0]);
(I havent tested the above code just replaced the sql statement)
That will give you "9.00.xxxx.xx"
Then you can just determine the version using the value 9. So 9 = 2005, 8 = 2000 and you can even go into more detail by easily retrieving the service pack they have installed if you need to.
However if you have to go down the long string route which it seems like you want to then using the array position will work but obviously the biggest flaw is if the strings are in different formats for different versions. (I dont know the answer to that)
Another solution could be using a regular expression to extract a 4 digit string or use the String functions like Contains or IndexOf but this is only useful if you know what you are looking for. i.e. "2000" or "2005".
|
|
|
|