|
Hi
What i need to do is to get keyboard letters and "letter combinations" which is the core of my problem
for ex:
when i press alt + f4 i wnat to see alt f4 in the label
i have the code snippet
protected override void OnKeyDown(KeyEventArgs keyEvent)
{
label1.Text = "";
label1.Text=keyEvent.KeyCode.ToString();
}
Can anyone show me a way to do it please?
Thanks...
|
|
|
|
|
hmmmm seems suspicious... but I think KeyEventArgs has something to detect if buttons like alt, shift, ctrl are currently pressed.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
forget the loop, loops seldom belong in an event handler.
Create one method that is used for both KeyDown and KeyUp events.
|
|
|
|
|
Check the value of keyEvent.Alt, it will be true if the alt key is held down.
|
|
|
|
|
Hi,
You can override the ProcessCmdKey() function in Control class like this :
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Alt | Keys.F4))
{
//Your Code
}
return base.ProcessCmdKey(ref msg, keyData);
}
Hope this helps,
ramz_g
|
|
|
|
|
Hi guys,
I am facing the following problem:
my application is downloading large chunks of data and informs the user about it (how many bytes of total bytes... how many % already loaded and so on).
this work is done by a component that informs the form by rasing a event. within the method which gets executed by the event happens a updatePanel.Refresh() (a redraw of the panel that shows the information)
because that event gets fired reasonable often, the updatePanel is redrawn all the time.
when I try to move the windows of the application it doesnt work properly.
what must I do to stop the refresh of the updatePanel when the form is moved around?
any suggestions welcome
thansk
best regards
t
|
|
|
|
|
well for one I assume the work is being done on a separate thread?
You could try limiting the update with a timer or counter...
for example if your updating with every downloaded byte of data you could update with every KB of data, or you could use a timer and then update only if a certain period has elapsed, then reset the timer with each update.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi mate,
thanks for sharing your idea. helped me impementing a quick solution to the problem.
basically, i use a timer and the forms-move event. i start the timer when the form is moved and let the timer point to a method whichs sets a flag, that the form is on the move. works like a charm.
thanks
best regards
t
|
|
|
|
|
Hi,
How can i perform Alt+T operation through programming in c#.net 3.5 Windows application.
Thanks In Advance
--Naren
|
|
|
|
|
That would depend on what Alt-T does in your application.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I want to open a topic using that
|
|
|
|
|
I am sorry, but you are using terminology with which I am not familiar.
What is a 'topic'?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
there are two easy ways:
1. create a menu item that does what you want ALT+T to do, then assign it ALT+T as a shortcut.
or
2. handle KeyDown (or KeyPress) event, check for the right key combination, and act on it.
|
|
|
|
|
hi all,
i m making a windows application in C#. i want to rotate a panel in this panel i am capturing a video, i want to rotate this panel so the video is also rotate with this panel can any one help me...
thanks in advance..
|
|
|
|
|
Not easily, no. The Panel control doesn't directly support being rotated to an arbitrary angle. WPF, on the other hand, will allow you to do this and render video in it. I suggest picking up a beginners book on WPF before proceeding. It's got quite a steep learning curve.
|
|
|
|
|
Hi peoples,
I am working in WPF screen,
i need to clear all the controls(values) in the screen at one stretch,
if win forms we can give as (foreach control in this.controls)
but here how can we do??
|
|
|
|
|
First of all, this is a WPF question.
Second, people here don't get paid to answer questions, so they may take some time to get to your question.
Third, it's bad form to repost a question just to bump it. It makes it less likely that you'll get an answer.
Fourth. I was writing a sample of the code for you to demonstrate how to do this, but now I don't want to finish it. You lost me when you posted this question.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi mr Pete O hanlon,
Actually, i didn't put again to bump my question here,and also i know that no body is getting paid for reply.
i already put the same in WPF message board, but i saw for the past two hours no reply for that..
but here in C# board lot of replies are coming, i thought no body is going for WPF forum,
so only i re posted here that's all.
|
|
|
|
|
Need 2 hour turnaround on your question? Pay someone to answer it. Otherwise, just wait patiently like everyone else does!
|
|
|
|
|
i dont want to give reply for ur post in common forum....
|
|
|
|
|
I have entered one question regarding WPF screen,in WPF message board, can any one reply for that?
|
|
|
|
|
yeah anyone that is a CodeProject member can reply to it. I would say wrong forum but i dont think there is a forum for question about who can reply to other questions...
Perhaps you should put in a request for one
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
but mr musefan, i think you are much genius among the genius..
i posted the question, but no reply there for more that two hours, so i asked these peoples to check that question and reply...
|
|
|
|
|
2 hours?? That's it?? That's all you waited??
We do this on a volunteer basis. We don't get paid to do this and just about all of us have real jobs we have to attend to. We answer questions when we can and for as long as we can spare the time. Your demanding of an answer is just going to get you ignored.
|
|
|
|
|
Hi all,
I have a textbox and one button in my form. After entering text in textbox I have to click on Ok button.
Insted of click on Ok button I want to press enter.
|
|
|
|