|
I'm guessing you want the listbox to go to the relevant entry, yesno?
listBox1 does not have the focus and so will not raise a keypress event. This is what I said to start with, they all need to change based on the single event rather then a single event being passed to each control.
You probably need to mimick a bit more, try looking at what happens when the value changes, what is the event you are getting?
[I'll push you in the right direction, but I won't write your code. sorry.]
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Yeah very nice... I like your game... Althought I don't quiet get when you say "they all need to change based on the single event rather then a single event being passed to each control". Yu mean create a single event handler that holds both controls?
Plus I kinda don't know what to respond on "what is the event you are getting?" Maybe keypress? or keyup??? I used keypress but sounds like there is a better event that I should be using?
|
|
|
|
|
OK..., make sense to create a single event that holds each control...
But I don't see it clear on how can I make the list-box be selected without being focused...? mmmm... I'll keep trying...
|
|
|
|
|
Here's the outline:
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (!e.KeyChar.Equals(Keys.Enter))
{
}
else if (listBox.SelectedIndex != -1)
{
}
else
{
}
}
private void listBox_DoubleClick(object sender, EventArgs e)
{
}
Each piece should be in a private method, don't polute the event handlers.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Make sense to do that. Thanks to the clue that you gave me I figure that it is possible to share a event method with two or more controls. (didn't know that before). I also figured how to select the list-box items by typing in the text-box.
The only thing is, I dunno how to stop a key-command from doing its job. For example: if I press the space bar while typing on the text-box a space will be added to the text-box. Is it possible to cancel that command and when I press the space bar no space will be added?
The C# book that I have doesn't talk about it and my search in Google isn't lucky... 
|
|
|
|
|
Hi I want to know that how to divide video files into its constituent frames using c#.net
|
|
|
|
|
If I understand you correctly, you should check out DirectShow.NET which is managed wrapper, you can then create graph with some frame grabber and "run" it.
|
|
|
|
|
|
First up learn where the shift key is, it will help you.
Secondly you haven't actually asked a question.
I can infer from your message that you can't work out how to do this. But what I am not sure is if this is due to not understanding a nuance of c# that has caused you to go in circles with an implimentation problem or because you are thick.
Please can you let us know!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
For You:
I just want to know how should i move the pixels so tht transparency between the pieces is gone.I have tried shifting the pixels row by row and also column by column but that is not working.... jus tell me any other way to do this....
|
|
|
|
|
Great, now you've asked a question and it looks like you've got spelling mastered.
If you haven't read Christian's article do so. The basic premise is that you must know the transparancy colour.
Will the blocks always move on just on plane or can they move on both?
You need to identify each block of image and move it enmase. Otherwise you will not know if you're going left/right or up/down.
Have a go and see where it's going wrong. Then come back and ask for some help at the next stage. Unfortunately, without knowing the method you are trying to employ it is rather difficult to help just yet.
Now read Christian's article (he's v. clever) then have a go at a solution. If you get, come back and ask for some help where you are not sure.
And have a Gin'n'Tonic, that helps as well.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You need to read my image processing articles. As the lines are not straight, you need to iterate over each row, and then build a new row using only non transparent pixels. If you can't see which are transparent, you may need to match based on color alone.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Here, I can see which pixels are transparent...
Now, if I build each row again using only non transparent pixels then there will be problem at the last rows of each puzzle piece as the transparent color there need not to be shifted as the puzzle piece below it will fill it.....
Thank you for replying...
|
|
|
|
|
Umangj wrote: heyyy pls help me...
Hey PLEASE stop begging
|
|
|
|
|
Its not begging, its called manners while asking for some help....
And it will be better if you can reply to the question asked and not how it is asked....
|
|
|
|
|
|
Hi,
if I had a single pixel with alpha=0 where I would like it to be 255, I would probably open up my toolbox and modify that pixel somehow. And if I had several, I would consider a loop, maybe even two of them.
Of course, if the information happens to be absent, I am not a magician.
BTW: your hardest problem may well be that one image is 150*106 while the other is 150*107
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi, to Every one, i want to use shortcut keys for my program functions, in example when a user clicks on the specific button a function calls by the program now i want, user can access to this method by pressing a specific key (like Alt+E) instead pressing a button... how can i do this ?
--
thanks to you all --> ![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
You need to setup keypreview for the form, and then listen to the KeyPress events. When the specified keys are pressed then call the necessary function. If I am correct some menu items can be automatically set for a key shortcut. So when the specified shortcut is pressed then the menu item click event is called automatically.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi, I'm a C# programmer, Can anyone tell me how can i take control to the system's hardwares ? and enable or disable them in Microsoft windows? by c# coding ?
---
thanks to U All ![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
You could emulate everything by going through the Device Manager, but why would you want to do this? Shouldn't this be done by the end-user and not a computer program?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi, im using a program called EES for calculating purpose. It supports using ones own compiled code, but requires specific header in the DLL file, and the file need to be renamed from .dll to .dlf.
When the program checkout the .dlf file, it will look for a function call, in delphi that would be:
function FuncName (var S:charstring; Mode:integer; Inputs:ParamRecPtr):double; export; stdCall;<br />
begin<br />
..<br />
In C++:
extern "C" {<br />
__declspec (dllexport) double SUM_C(char s[256], int mode, struct EesParamRec *input_rec)<br />
{<br />
...
In C# ???
Among many i tried:
public class Globals<br />
{ <br />
public static double SUM_C(char[] s, int mode, ref EesParamRec input_rec)<br />
{<br />
...<br />
(EESParamRec is a class that handles the EES call)
Full code and so on can be found here:
Page 218 and rest of chap 6(EES integration examples)[^]
Unfortunatly no mentioning of C#
Since EES is only used by engineers working with thermodynamics, the resources on the internet is close to non existing, i know this is a long shot, but please help if you can.
|
|
|
|
|
You'll have to get ahold of the manufacturer of EES and see what you have to do, or if it's even supported. From your decription, it would appear that whatever you use has to support writing a standard library .DLL. C++ and Delphi support this. C# and VB.NET do not.
|
|
|
|
|
Thanks for the answer, the manual also says that it must be dynamic link library, but i dident know that MS removed that from C# (new to coding), so currently im at a dead end. Im goana try to make a C++ wrapper for my C# code, and call it that way, ultimately im goana have to port the whole thing to C++ ... Anyways thanks again.
|
|
|
|
|
My final year project is Video Collection system using C# and in this project i want to store videos information and videos at remote server. i want to know how information is sent to server and how these data store in database at server. I have to submit my project on 10 April. Please help me.
Thanks 
|
|
|
|