|
I'm assuming you're using a richTextBox or textBox. But look at the KeyPress[^] event of the control, use can use the event args to determine which key was pressed. Handle the key that was pressed as you wish.
He who makes a beast out of himself gets rid of the pain of being a man
modified on Tuesday, February 19, 2008 4:19 AM
|
|
|
|
|
Hi All,
Stuck in a weird position. I have written a code which lists the various documents in a folder.
As soon as I click on the names of the documents they open up as they are. Word files in Microsoft Word, Excel in Excel etc...... The functionality works absolutely fine as long as I am debugging.
As soon as I fire the same Application from IIS 5.1, the listing is proper, but on the click of the names nothing happens. I have even checked the taskmgr and can c the respective processes like WINWORD.EXE, EXCEL.EXE running, but I cannot c the docs.
Can u guys help me plz?
|
|
|
|
|
Hey,
I think i understand how to asynchronously call a method so that the main thread isn't blocked until it ends. I also think i know how to use the Thread class for the various threading scenarios - starting etc, synchronizing, ThreadPooling etc. I have also read about when an application should consider multi-threading and when it should be avoided.
However i don't know when to go with an Async call over using the Thread class?
Any help much appreciated.
Simon.
|
|
|
|
|
I think here[^] you will learn when to create new threads.
SkyWalker
|
|
|
|
|
Exactly what i couldn't find. Many thanks.
|
|
|
|
|
|
Converting value type into reference is Boxing, and vice-varsa is UnBoxing.
|
|
|
|
|
ReenaSharma wrote: Converting value type into reference is Boxing
Almost.
You don't "convert" anything - boxing is the process of placing a primitive type in an object so that the primitive type can be used as an object. See this Wikipedia[^] link.
/ravi
|
|
|
|
|
let's say we have these 2 classes. Class B inherits from class A
class A
{
}
class B : A
{
}
in the following code
A obja;
B objb = new B();
obja = objb; // boxing
B objc = (B)obja; // unboxing
We can say,
Boxing is assigning an object of the child type to an object of the parent type (higher in the inheritance hierarchy)
Unboxing is (casting) assigning an object of the parent type to an object of the child type.
see also
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: Boxing is assigning an object of the child type to an object of the parent type
No, that's not correct. There is no boxing going on there.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Maybe I'm wrong, but this is how I understand it, and I'll be grateful if you clarify this point to me, please.
B objc = (B)obja;
Isn't that unboxing?
Eslam Afifi
|
|
|
|
|
No, that's not unboxing.
Unboxing is when you extract the value from a value type that is stored as an object. What you are doing is merely changing the type of a reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you. Now I get it. But I have one question. Does this reference conversion consume much time as unboxing?
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: Does this reference conversion consume much time as unboxing?
No. Reference conversion doesn't create a new object, it only verifies that the object can be used as the desired type and then copies the reference. If you convert from one known class to another, the verification can be done by the compiler, so the only thing that is done at runtime is copying the reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ok. Thank you so much.
Eslam Afifi
|
|
|
|
|
Have a look at this[^] entry in wikipedia.
|
|
|
|
|
|
Eslam Afifi wrote: class A
{
}
class B : A
{
}
in the following code
A obja;
B objb = new B();
obja = objb; // boxing
B objc = (B)obja; // unboxing
Wrong!
Boxing does not happen with instances of classes.
|
|
|
|
|
|
Boxing is copying a value type (C# struct) to a reference object in the heap.
Unboxing is copying a boxed object in the heap back to the stack.
Not just primitive value types:
struct S : ISomeInterface
{
...
}
// boxing
S s1 = new S() ;
object x = s1 ; // S instance is created on the stack, then copied to the heap.
ISomeInterface is = s1 ; // This is also boxing
...
S s = (S)x ; // This is unboxing, for unboxing you must use the cast syntax.
Value types are not always placed on the stack, they are inline into it's container. They might be already on the heap, for instance if they are array elements.
S[] a = ...
a[i] = (S)x ;
Boxed value is copied from the heap to the stack and then copied into a[i].
|
|
|
|
|
Hi all!
I have added a combobox control in the datagrid. I want to restrict user to select the value which is already selected in the datagrid.....
Thanx for ur help in advance!!!!
|
|
|
|
|
|
i made a skydome for my model using xna and it displays very well. but for some computers, it doesn't show. is it something wrong with my coding or the hardware?
|
|
|
|
|
Sounds that way...
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 )
|
|
|
|
|
I need to know the license in which a software could have at the end
In some applications you see many expressions about that ,would any descibe me or
give me a link to that?
Thnaks
|
|
|
|