|
I just found something really cool!
PrintDocument.PrinterSettings.CreateMeasurementGraphics() does EXACTLY what I need!
|
|
|
|
|
Helo
Need Help,Iam new to c#,
How can i merge columns and rows in Data Grid Same like Vb6. flex grid.
|
|
|
|
|
I need a way to create a hook that moniters both the mouse and keyboard input globally. Any ideas.
Using C#
I have seen some other articles, but they are much more complex than I need.
All I really need the program to report is the mouse's coordinates(x,y) and ANY key that is pressed, including Ctrl+S or whatever.
Thanks for any help or guidance.
|
|
|
|
|
What about This. It hook the keyboard, and mouse event as well.
|
|
|
|
|
My application allow user press Ctrl + S to save changes to document.
But how can I get this event?
|
|
|
|
|
You can subscribe to your form's KeyDown event. Then using the KeyEventArgs parameter to parse out what key was pressed.
If for some reason this isn't enough information for you, just let me know.
/\ |_ E X E GG
|
|
|
|
|
You can find a lot of example, and complete code/components in Here
|
|
|
|
|
Use the Shortcut property of the menu item in your main menu. That way it'll show up there too.
If you have a main menu, that is.
|
|
|
|
|
I think we have to check if the S is press while Ctrl is pressing.
It confuse me!
|
|
|
|
|
There's a setting in the main menu object properties that lets you choose from like a hundred different key combinations, Ctrl+S is one of them.
Otherwise, you can set a KeyDown event, and do this:
<br />
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)<br />
{<br />
<br />
if(e.Modifiers == Keys.Control && e.KeyCode == Keys.S)<br />
{<br />
}<br />
}<br />
<br />
|
|
|
|
|
reinux, thank you for your helping.
I think that is what I need.
|
|
|
|
|
I'm trying to implement a module that transmits custom objects through net(between tcp clients), I'm familiar with such thing in Java(ObjectInputStream and ObjectOutputStream). My question is: is there are something like that in C# and how to use it?
Thanx in advance, Evgeny
evgenyus
|
|
|
|
|
Yes there is. Look for the System.Runtime.Serialization namespace. There you'll find a BinaryFormatter and a SoapFormatter class for serializing the objects. You can then use the NetworkStream to transfer them over. Something like
using System.Runtime.Serialization.Formatters;
void SendObject(object o, Stream s)
{
new BinaryFormatter.Serialize(o, s);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have a .gif I downloaded off the net as an Image type in my code. How can I take that and have it displayed as the icon for my NotifyIcon.Icon ?
/\ |_ E X E GG
|
|
|
|
|
Bitmap b = new Bitmap("filename.gif");
b.Save("d:\newname.ico",System.Drawing.Imaging.ImageFormat.Icon);
Icon c = new Icon("d:\newname.ico");
this.notifyIcon1.Icon = c;
|
|
|
|
|
Have you actually tried this, because I think I did something exactly like that and it didn't work.
/\ |_ E X E GG
|
|
|
|
|
Why? what was the problem? Maybe try convert that .gif to .ico with some application?
David
|
|
|
|
|
Argument Exception, "Argument 'picture' must be a picture that can be used as a Icon."
/\ |_ E X E GG
|
|
|
|
|
|
If I use the code LongHC provided, it dosn't work at runtime. Then if I try to make NotifyIcon.Icon the icon that LongHc's code created I get the same error except in a messagebox in the designer.
---------------------------
Microsoft Visual Studio
---------------------------
Argument 'picture' must be a picture that can be used as a Icon.
---------------------------
OK
---------------------------
/\ |_ E X E GG
|
|
|
|
|
Yeah, I get an ArgumentException, "Argument 'picture' must be a picture that can be used as a Icon."
/\ |_ E X E GG
|
|
|
|
|
Sph, forget CodeProject, I did it myself.
WebRequest requestIcon = WebRequest.Create("http://www.met-office.gov.uk/images/w1x15.gif");
WebResponse responseIcon = requestIcon.GetResponse();
Image image = Image.FromStream(responseIcon.GetResponseStream());
responseIcon.Close();
Bitmap b = new Bitmap(image, 16, 16);
notifyIcon1.Icon = Icon.FromHandle(b.GetHicon());
/\ |_ E X E GG
|
|
|
|
|
How can I add a type Image or any picture/image to a ListView at runtime without using an ImageList .
For example, I have an image type Image , I just want to add it to a row in my ListView .
So far the only way I've been able to do this is by first making a SmallImageList and putting my Image in it, then associating that ImageList with my ListBox , and then setting the ImageIndex to 0 for my Image .
That's alot of work. Can I simply just add an image?
/\ |_ E X E GG
|
|
|
|
|
No, you can't. Even each item in a ListView can have it's own ImageList.
But in no case can you just "add an Image" and move on.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok, thanks.
/\ |_ E X E GG
|
|
|
|