|
Hi,
I want to display the screen coordinates of the mouse as I move the
mouse around the WinForm.
I want to qualify this question by the following:
1. I DON'T want an L-Button or R-Button click to display the coordinates.
1. I want to see the coordinates on the form. not in a TextBox etc...
thanks a lot....
|
|
|
|
|
I have made a program (script) using AutoIt that does exactly that thing. Do you want that program? Download it from my homepage. It also shows hexadecimal color value of a cursor pixel. You can measure relative mouse coords by writing your window position in the number fields and press go.
-- modified at 17:45 Thursday 15th December, 2005
|
|
|
|
|
Thanks for your offer but I'm just looking for the nuts and bolts of how to do this
being a novice programmer. Also I wouldn't know AutoIt from a script in the first place...
All I want to do is move the mouse around and see the mouse coordinates in real time on the screen.....
|
|
|
|
|
Add the following code to your form:
Point myMouse;
protected override void OnPaint(PaintEventArgs e)
{
Point screen = PointToScreen(myMouse);
string location = screen.ToString();
e.Graphics.DrawString(location,
SystemFonts.DefaultFont,
SystemBrushes.ControlText,
(PointF)myMouse);
}
protected override void OnMouseMove(MouseEventArgs e)
{
myMouse = e.Location;
Invalidate();
base.OnMouseMove(e);
}
-- modified at 19:42 Thursday 15th December, 2005
For some damn reason codeproject is lowercasing onmousemove. It should read On Mouse Move (remove spaces)
|
|
|
|
|
Thanks very much. I'll test it out.....
|
|
|
|
|
What should be the connect string if I want to connect to a Windows 2003 shared fax? I've tried using the name that apears under "Printers and Faxes", but I got an exception. I could fax fine if I use my local driver. Any ideas?
// this uses the local fax driver and it works
faxServer.Connect(null);
// this tries to use the shared service and it raises an Invalid handle exception
faxServer.Connect("server name");
tom d
|
|
|
|
|
I am attempting to convert a Word document with Headers on every page into the Text document. The headers are getting appended to the end of the text document rather than getting included within the body of the document. An thoughts or suggestios on a solution ?
|
|
|
|
|
hi
I need a sample code than can print from a section of a web page .
for example I can print the content of a table in web.
Best wishes
|
|
|
|
|
In my server, I am using Asynchronous socket connections. After a client connects, the server Asynchronously waits for the login credentials using Socket.BeginReceive. I have not had this issue yet, but in the what ifs....
Suppose a client connects, is sent a promt from the server to enter login credentials, then just sits there sending nothing. The server holds that asynchronous operation indefinately until something is sent or the client disconnects. How would I time out that operation? I dont think SetSocketOption works on asynchronous operations.
The server would not stop accepting connections by design, but it would keep that socket open, and I dont want that. Any ideas?
Thanks
c#guy
|
|
|
|
|
|
Really? I set the receiveTimeout option for 100ms, and after about 5 minutes the client was still connected. Are you sure?
|
|
|
|
|
Hello,
I have a task to design an e-recruitment project and I’m having difficulties in coding the methods that are responsible for adding, updating, saving, and deleting objects in my project!!
I’m supposed to code these methods using C# can you help me
Thanks
marmosha
|
|
|
|
|
Hi there,
The question is rather vague... What is the difinition of the objects in your project??
<< >>
|
|
|
|
|
The objects are: users, CVs, and jobs
Users are supposed to be of 3 types (admin, normal, and manager)
The admin can add, delete, and update jobs and can preview the CVs
The manager can do the same thing as the admin but on part of the jobs and the CVs
Normal users can add, update, delete CVs, plus the ability of previewing and applying for jobs.
is that what you are asking about!! hope so
marmosha
|
|
|
|
|
So do u need someone design whole project for you...???
If so, I'm afraid of ... becoz it'll take so much time...You should ask specific questions here...
You yourself have to think about the design and write it on paper first, and ask...
<< >>
|
|
|
|
|
What are you using for a database?
Brian Van Beek
Inside this room, all of my dreams become realities, and some of my realities become dreams. -Willy Wonka
Just started a new blog, yeah! [^]
|
|
|
|
|
im using access!!
marmosha
|
|
|
|
|
I am writing an application in C#. It will be a recipe manager. I would like to be able to use a different file format such as file.recipe or something. How would I go about doing that while associating my application with that file type? Also, how would you go about reading and writing to a file such as this?
Thanks!
|
|
|
|
|
Hi there,
This link File Ext might give u an idea...
<< >>
|
|
|
|
|
What about reading the file, line by line?
Thanks for the reply.
|
|
|
|
|
The link I gave you is just about how to associate a file extension with an application.
About reading file: this is your own file, your program create it. And certainly, it also understand and know how to read it, right?
<< >>
|
|
|
|
|
Ok, just didn't know if you needed to do anything special like a binary reader or something to get the info out of a file or to write to it. I fiddle around with it for a while.
Thanks
|
|
|
|
|
The easiest way to do both is:
to make the file extension add a deployment project (to create a installer) go to the file type editor and add the details about extensions, commands and what not. when you run the setup the file association will be made for you, complete with icons etc etc
As for a file format, have you considered using a Dataset to store your recipe internally. You can validate the "file format" with schema's and you can read and write datasets to disk with the XML functions. You can easily share them with other apps etc, and they provide a nice logical way to manage a recipe.
|
|
|
|
|
I didn't know you could do that! I'll look into XML, so would you still just use an xmlreader? I'm not a complete newb to programming but am to working with files.
Thanks
|
|
|
|
|
No not a XMLReader.
Define your recipe as a dataset (drag on onto your form), go to properties and set the table, then set the columns in the table.
Add a row, filling it with the recipe information the user enters (i assume)
to save it to disk use DataSetName.WriteXML(name of file here)
if the user want's to open the dataset use the ReadXML method of your dataset passing it the filename to open. you can get this as a command line argument to your app.
MSDN or Google: Dataset.WriteXML, DataSet.ReadXML, C# Command Line Arguments, SaveFileDialog, OpenFileDialog
Sorry it is brief but I am about to run out. I will be back in an hour if you still have no luck, but the MSDN documentation for dataSets and XML is great
|
|
|
|