|
Hello everyone,
How can I check if the mouse is inside or outside the client area.. To be more specific I have tried to make a calculation for inner controls but this do not work for the Form.
I am doing a drag-drop operation and I need to know when the user tries to drag something outside the main form. Is there a way to achieve ?
Thanks in advance and best regards !
.:: Something is Wrong ::.
|
|
|
|
|
Hello,
You could set a flag at the MouseLeave event of the Form.
Hope that helps!
All the best,
Martin
|
|
|
|
|
Thanks for your reply but it doesn't work.. I add a MouseLeave event which set the mouseInside booleand to false and a MouseEnter event which set the same boolean to true..
But interestingly when my mouse is over a control inside the Form the MouseLeave event is fired..
.:: Something is Wrong ::.
|
|
|
|
|
for which controls are you useing MouseLeave and MouseEnter events?
I think you should specify those two events for every control in you form.
Hope it helps
|
|
|
|
|
I use them hust for the main form, but definin those events for every control won't either work
.:: Something is Wrong ::.
|
|
|
|
|
Ohh,
sorry!
How are you draging a control of your mainform outside the mainform?
Martin
|
|
|
|
|
Well the exact problem is this. When the user drags a control the control moves with the mouse. When the user drops the control, the program makes some calculations and decide what to do with the control (return it to its original point, leave it where it is dropped, dispose the control etc.).
The user is expected to drag-drop inside the main form but as everyone know the user is the one who do not use the program as expected
So when the user tries to drag the control outside the main form (sure the control stays inside the form but the mouse is outside and the left button is released outside) no calculations which are done in the drop event are made.
.:: Something is Wrong ::.
|
|
|
|
|
Hello,
So you have the possibilty to add the MouseLeave event additionaly to the controls.
Then you could set a flag if it is dragged and reset it if it was dropped.
If the mouse leave event is fired and the flag is still set, you have the possibility to validate whatever you whant!
Hope to help you now!
All the best,
Martin
|
|
|
|
|
I have similar problem. Don't we have any other solution other than adding MouseLeave and MouseEnter to inside controls.
Thanks
Muthu.
|
|
|
|
|
Hello,
Sorry, but I have no other solution for you!
All the best,
Martin
|
|
|
|
|
Hi
I have a C# Windows Application that copies a lot of data between different databases. All the copying is being controlled by a method in a helper class and this method is being called when the user clicks a button on the Windows form. Is there a way of showing the progress of this copying in a progress bar in the Windows form?
Thanks.
Kobus
|
|
|
|
|
You could add an event to your helper class that provides some progress information and is triggered by the copy method. Before calling thios method, register to the event and adjust the progressbar according to the information provided by the event.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
You stole my signature
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 homepage Oracle Studios[ ^]
|
|
|
|
|
You could run the method inside of a BackgroundWorker. With the BackgroundWorker you can get the progress of the method through its properties and you can define how the progress...well progresses.
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 homepage Oracle Studios[ ^]
|
|
|
|
|
i want yo know that how i can add data from a table into a drop down.
ursbuddy
|
|
|
|
|
SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["YourConnStr"].ConnectionString;
<br />
SqlDataSource1.SelectCommand = "select * from yourtablename";
SqlDataSource1.DataSourceID = "SqlDataSource1";
SqlDataSource1.DataTextField = "ColText";
SqlDataSource1.DataValueField = "ColVal";";//DataValueField represent value<br />
SqlDataSource1.DataBind();
Hope this helps
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
|
you are welcome...
example which i posted before to you it's in VS2005
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Hi,
For example, you can fill a Dataset using ADO.NET (Oledbconnection, OledbAdapter and Oledbcommand) and then set in the dropdown the property DataSource the dataset as value.
Example of the dataset filling:
//create the conn
OleDbConnection con = new OleDbConection("conection string");
//create the command
OleDbCommand cmd = new OleDbCommand("SELECT <field> FROM ", con);
//create the DataAdapter & DataSet
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
//fill the DataSet
da.Fill(ds);
|
|
|
|
|
thnxs very much
i'l try this.
u people are very helpful
thnxs again
ursbuddy
|
|
|
|
|
Hi all,
I have an application which will be installed on the user machine.
The application has two main parts.
First application checks for the new updates from the server and then invokes the other application using the dll.
The second application is what the user actually interact with.
The application minimizes to the system tray.
The user may close or minimize the form that is displayed.
My main objective here is if the application is running and the user again clicks on the Shortcut that is placed on the desktop.
The form that is minimized or was closed should be displayed.
How do i do this?
Hope i have put the problem properly to everyones understanding.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hi Yadav
Guess the following 2 links will help you.
http://msdn.microsoft.com/msdnmag/issues/05/09/NETMatters/
http://www.codeproject.com/threads/simplesingleinstanceapp.asp
Thanks and Regards
Pani
|
|
|
|
|
Thanks for the links...But I have to display a form from another assembly...
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Does the shortcut point to the actual application or the "launcher" application? Either way, you could check for the existence of the process first off and switch focus to it if you find it running. Something like
bool IsProcessAlreadyRunning(string processName)
{
Process[] processes = Process.GetProcesses(processName);
return (processes != null && processes.Length != 0);
}
If the above method returns true, you know that an instance of the process is already running. You could then use the MainWindowHandle[^] of the corresponding Process object to get the window handle and P/Invoke some Win32 API (Activate?) to bring the existing process' window into focus.
Hope this helps.
|
|
|
|
|
Hey Friends,
I want to develop a virtual storage drive project in .Net. but confused about how to start?
I have alerady created a web drive solution which working using WebDav protocol, but it uses Iexplorer to display files and folders.
Whereas i want to display the folders and files in Windows explorer (Something exactly like What Gdrive software works)
Can anyone help me to distingush the webdrive and virtual windows drive?
Please post the articles or sourcecode related to this issue..
Thanks in advance
|
|
|
|