|
If you mean something like
this.KeyDown += System.Windows....
It doesn't work, because KeyDown works when the object has focus and it doesn't a Child does.
|
|
|
|
|
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
MessageBox.Show(e.KeyCode.ToString());
}
This works perfectly fine for me as long as the form is the active window.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Yes I know but the form isn't the active window
|
|
|
|
|
|
thank you excactly what I needed.
|
|
|
|
|
What about setting key preview?
If you set KeyPreview to true for your main form then use the key press event, it might get called even if your on a child window. You'd have to check though. It would be much easier than a global hook if it works.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
It works only if the form is active form
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Hi,
Recently working on an application thats needs to recieve files from an server.
What i need is for the datagridview to display the filename , filetype and the time it was recieved.
But i cant seem to get it to work, do i need to use the FileWatcher linked to the datagridview?
I appreciate any suggestions.
Thanks in adavance
Ben
|
|
|
|
|
You cannot directly associate the filewatcher with the data grid. What you may like to do would be add code to get the details of files in a data table in the events of Filewatcher and bind them to your data grid.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Alright thanks , i'll look into it
|
|
|
|
|
hi
I know that this question may sound foolish ....
still i expect answers
What is difference between c# and c#.net
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
|
ALT + F4 wrote: What is difference between c# and c#.net
<br />
string strone="C#";<br />
string strtwo = "C#.Net";<br />
Console.Write(strone.Length.ToString());<br />
Console.Write(strtwo.Length.ToString());
Ans:
2
6
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
.NET is the Microsoft implementation of the CLI, so C#.NET implies the Microsoft implementation of the C# language.
However, if you are using something other than the Microsoft implementation, you should specify it, so unless you specify any other implementation, C# and C#.NET means the same thing.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
I wrote a little Server and run it under Win 2003 and Win 2008,
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)]
[WebService(Namespace="http://www.pyramid.de", Description="Pyramid")]
public class WormRaid : System.Web.Services.WebService
{
[WebMethod(MessageName="WriteBytes")]
public long WriteBytes (byte[][] memData)
{
return (memData[0].Length + memData[1].Length);
}
}
Now my problem is that the second byte array in a byte[][] is always received as 0 bytes, when the first byte[] length is a odd multiple of 1024 (1024, 3072 or ...). This error occurs only without MTOM, with MTOM everything works fine (see attached code).
The error is probably in the server side because the same error can be produced with a GSoap Client (also without MTOM).
Here my Client Code:
internal static int Main (string[] args)
{
long fsize1;
long fsize2;
long byteswritten;
byte[][] ba;
WormRaid wr;
Random rand = new Random();
try
{
fsize1 = 1024L;//only odd multiple of 1024 will not work
fsize2 = 512L;
Console.WriteLine(" (" + fsize1 + "), (" + fsize2 + ")\n");
// Create the data to send
ba = new byte[2][];
ba[0] = new byte[(int)fsize1];
rand.NextBytes(ba[0]);
ba[1] = new byte[(int)fsize2];
rand.NextBytes(ba[1]);
//Create Stub
wr = new WormRaid();
wr.Url = "http://localhost/WSE3Test/WSE3Test.asmx";
//First Test will work always
Console.WriteLine("WSE3 MTOM:");
wr.RequireMtom = true;
byteswritten = wr.WriteBytes(ba);
if (byteswritten != fsize1 + fsize2)
{
Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));
}
else
{
Console.WriteLine("OK\n");
}
//This test will fail
Console.WriteLine("WSE3 without MTOM:");
wr.RequireMtom = false;
byteswritten = wr.WriteBytes(ba);
if (byteswritten != fsize1 + fsize2)
{
Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));
}
else
{
Console.WriteLine("OK\n");
}
}
catch (Exception exc)
{
}
}
Sample output:
-------------------------------------------------
Y:\>Client.exe
(1024), (512)
WSE3 MTOM:
OK
WSE3 without MTOM:
!!! ERROR LENGTH !!!
Written: 1024, expected: 1536
-------------------------------------------------
Get anyone the same results?
Is there any known solution for this Problem?
Thank you,
-- Daniel Wehrle
|
|
|
|
|
Ok, I had this simple image box and when setting the image property to my 1 pixel width image, I see a stupid fading effect applied to my image?? Why does the IDE have to nose in and "fix it" for me
Please help
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If you want a solid color, you have to use nearest neighbour scaling instead of bicubic scaling. If the control has no propery for changing this, you have to scale the image yourself before putting it in the control.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hey Guffa!
Thanks, but it's not working, I believe it has something to do with PixelFormat that I cant set
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: Thanks, but it's not working
What's not working?
Muammar© wrote: I believe it has something to do with PixelFormat that I cant set
How do you try to set it?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Create a new bitmap of the same size with the PixelFormat you want and copy the old image into this one.
|
|
|
|
|
Hello Mr. Solo
Sorry but DOH , can you tell me how to do it?? Did you try it??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi All
Who I Can Add Footer To DataGrid Or DataGridView In .Net By Using C# Code
In Windows Application ??
This Option May Be Tack To Cerate New Windows Application Control Inhert From DataGrid Or From DataGridView .
Who I Can Do That ?
Thancks For Any Body Help me
Thaer
|
|
|
|
|
Code(C# .Net 2.0):
private System.Windows.Forms.ToolStripButton toolStripButton_Scan =new System.Windows.Forms.ToolStripButton();
this.toolStripButton_Scan.ToolTipText = "New transaction created from scan";
question:
How to change the style of the text "New transaction created from scan".
Thank you!
|
|
|
|
|
The simple answer is: you can't.
If you really really have to, it might be possible by handling the tooltip yourself.
To do this you'll need to:
(1) Create a tooltip you can maintain reference to.
(2) Implement your own draw via the Draw event, drawing the desired string via the graphics object provided.
(3) Intercept the appropriate mouse events to popup and clear the tooltip.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Thank u.
Now,I can get the tooltip by the sentence like this:
ToolTip tip = (ToolTip)ToolStrip1.GetType().InvokeMember("ToolTip", BindingFlags.GetProperty | BindingFlags.NonPublic|BindingFlags.Instance, null, ToolStrip1, null);
I'm able to change the backcolor , forecolor etc.. Except the fontsize.
My purpose is to change the fontsize. how to do it ?
|
|
|
|