|
I'm using VS2003 and the event Move comes at the end of moving.
|
|
|
|
|
I tried it out, but it is not exactly what i'm looking for.
I'm trying to detect when the user releases this mouse button and drops the Form.
|
|
|
|
|
Hello,
Maybe you should set a flag if the Movement is done.
Then you should watch MouseUp Event. If the flag was set before then you should know that movement is finished.
Hope I helped you
All the best,
Martin
|
|
|
|
|
That is also a sollution i thought up. The problem is that i'm using one Form to draw another. So i have to pass the MouseUp event from one Form to the other Form, looks like a new quest... any hints on how to do that?
|
|
|
|
|
Oooooooook,
Is this next asumption correct?
Form1 is your main Form.
Form1 creates an instance of Form2 during runtime.
So which is now the Form to move?
Should there be an effect on the "not moved Form" by the "moved Form"?
|
|
|
|
|
Yes, your assumption is correct.
Form1 is a with with some transparency and layered window effects. It creates Form2 that has some ordinairy controls. Form2's location is linked to Form1, so when Form1 moves Form2 also moves. When moving Form1, the OnMove event of Form2 is launched so that goed allright. The problem is that is can't seem to get a OnmouseUp/Down/Click event on either Form1 or Form2
The reason for trying to detect the starting en stopping of the Form movement is that i'm trying to emulate the transparency of a Listview. The Listview has a backgroundimage of the underlying desktop. When the Forms start to move i'll set the backgroundimage to none. When the Forms stop moving i'll recreate the underlying background image of the Listview.
-- modified at 7:17 Wednesday 26th July, 2006
I just noticed that the OnMouseUp/Down/Click event only fires when clicked inside the form area and not when clicking on the titlebar area.
|
|
|
|
|
Maybe "LocationChanged" makes it easier for you?
<code> private Form Form2;
private bool block;
/// <summary>
/// Constructor
/// </summary>
public Form1()
{
InitializeComponent();
CreateForm2();
}
private void CreateForm2()
{
Form2 = new Form();
Form2.LocationChanged+=new EventHandler(Form2_LocationChanged);
}
protected override void OnLocationChanged(EventArgs e)
{
DoSomething(true);
base.OnLocationChanged (e);
}
private void Form2_LocationChanged(object sender, EventArgs e)
{
DoSomething(false);
}
private void DoSomething(bool flag)
{
if(block == false)
{
block = true;
if(flag)
{
Form2.Location = Form1.Location;
}
else
{
Form1.Location = Form2.Location;
}
}
else
{
block = false;
}
}</code>
Hope I got it now.
All the best,
Martin
-- modified at 7:25 Wednesday 26th July, 2006
|
|
|
|
|
Well actually the linking of the two forms goes allright, here's the code i use:
<br />
Form2.Location = new System.Drawing.Point(this.Location.X + 15, this.Location.Y + 32);<br />
It's the detection of final stop of the Forms movement when the user releases the right mouse button and the Forms settle on the desktop.
|
|
|
|
|
Hello,
I think System.Windows.Forms.Form.DragDrop should do it.
Arrives at end of dragdrop action.
All the best,
Martin
|
|
|
|
|
I've tried it and i think dat the dragdrop event only works for controls being dragged or dropped. It doesn't fire an event for Forms that are being dragged.
There has to be some sort of simple sollution, i'm thinking of creating a thread that watches the position of the Forms and generates a custom event... But i prefer a more simple sollution.
|
|
|
|
|
I want to create a tab menu - horizontal with all the tabs left justified
except for the last one which I want right justified.
|------------| |----------| |---------| |---------|
|---------| |---------|
|------------|--|----------|--|---------|--|---------|
|---------|
Thanks
bijaya
|
|
|
|
|
Hello all,
I created setup and deployed it in target machine. My main GUI application referenced several dll with CopyLocal=false at design time; Now the those dlls are placed in different folder on the target machine. when i run the application(EXE) on target machine it throws me the err "Cannot find the file(DLLNAME )". How can i tell the CLR to look the specified dll's paths.
I don't want my dlls to be installed in GAC. since it needs stuff like Strong Name,versioning. i don't want these features.
Here i have tried 2 things.
1) i have added the dlls path in Environment variable Path
2) I tried to use GUIs app.config like this
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Common;Shared;Group"/>
</assemblyBinding>
</runtime>
</configuration>
BUT NOTHING WORKS for me . Any suggestion
Thanks and Regards,
Srini
-- modified at 3:05 Wednesday 26th July, 2006
|
|
|
|
|
You can get some information on finding your DLL here[^]. However you have a hardcoded set of paths. If you have the dll's located in any possible folder, then they should be registered in the GAC. This will also improve the performance of the load since the GAC is the first place the framework looks when it goes to load an assembly.
Personally, I'd register those DLL's in the GAC and leave it at that.
|
|
|
|
|
I am working on project in c#.net that requires desktop dialing.
Requirement: We want to connect EPABX with the Computer Server machine(which is connected to other Client machines by Local Area Network-LAN). When user initiate a event on the client machine for dialing(etc) the request goes to server machine and then server machine sends request to EPABX.
Question:
1. How we can connect EPABX with computer server.
2. How server machine send request to EPABX.
Please guide.
Ashwani
|
|
|
|
|
HI,
Anyone can tell me how to to save the doc files in C.
arun
|
|
|
|
|
Do you mean C, C++, or C# ? By doc files, do you mean Word documents, or a document format of your own choosing ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
i have a win form... and i'm changing it's properties at runtime (e.g. BackColor) at some point i want to get back the orginal BackColor.. the color i specefied at design time.
when i'm creating a new instance of the form and trying to copy the BackColor from it it's not working! it's as if i changed the class not an instance of it at runtime!!!
please help me
|
|
|
|
|
If you create a new instance of the form that means you have a new form and you change the color of the new form. If you just want to change the backcolor, then use:
this.BackColor = Color.Red; //(for example)
|
|
|
|
|
LOL - I just answered this on MSDN. Your form needs to call InitialiseComponent in order to have it's properties set. Create a method that sets the default properties, call it after InitialiseComponent and then call it again if you need to reset.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
Before you change the Forms BackColor you have to save it at a global Color variable
<code>
private Color oldBackColor;
private void youreMethod()
{
//save your color
oldBackColor = this.BackColor;
this.BackColor = Color.???;
}
private void youreothermethod()
{
//get back youre color
if(Iwhantit()==true)
this.BackColor = oldBackColor;
}
</code>
Hope that helps you.
All the best,
Martin
|
|
|
|
|
Hi all,
Greetings...I'm using range validator for date validation.In that i've channged the Type as 'Date'...but the Maximum Range of the Date is no accessing...can any one tell me how to rectify this...
Babu
|
|
|
|
|
Please tell me what I am doing wrong. I have some problems using Crystal Reports. I have for an example an Access database with a table called "Authors". I connect to the database using the server explorer in VS.NET 2005, I create an OleDbConnection and a DataAdapter. I use the Generate Dataset option from the DataAdapter to generate a Typed DataSet called dataSet1. I load data into the DataSet using the Fill method from the DataAdapter. Then I insert a new Crystal Report Document Using the Wizard and I add as data source From the Project Data/ADO.Net Datasets the dataset1.Authors. I add all the fields from the dataset and I add an Crystal Report Viewer control to the main form. I use the folowing code to set the ReportSource filed of the viewer:
CrystalReport1 cs = new CrystalReport1();
this.crystalReportViewer1.ReportSource = cs;
Ok, when I run the Application the Crystal Report Viewer it lists nothing from the DataSet data. What is wrong?
|
|
|
|
|
Yay I found a solution just by adding one line of code to the code from above:
CrystalReport2 cs = new CrystalReport2();
cs.SetDataSource(this.dataSet11);
this.crystalReportViewer1.ReportSource = cs;
|
|
|
|
|
Thanks for this - much appreciated.
Wish I'd found it two days ago
Glen Harvy
|
|
|
|
|
The EnableAutoDragDrop property for the RichTextBox gives the ability to copy text when dragging. Is there anyway to fix this so that the text is moved instead?
Also, just overriding dragEnter and dragDrop with e.Effect = DragDropEffects.All; gives seemingly flawless DnD behavior without the use of DoDragDrop or having to trace the drop index using the coordinates. How come this method isn't mentioned anywhere?
Any suggestions on how to get DnD working on a RichTextBox would be greatly appreciated. Please and Thank you!
// Mikzi L. Freeman
|
|
|
|