|
Hi,
Get the x position of the mouse location. If the X attribute of the first position is less than the second, the mouse will bi moving clockwise, vica versa.
Good luck
jamil abou khalil
|
|
|
|
|
Take three different sample points A, B, C visited by your mouse.
Compute the vectors AB = v1 (v1x, v1y) , AC = v2 (v2x, v2y).
Sign of v2x* v1y - v1x * v2y will tell you the result:
positive = clockwise.
0 = aligned visited points
negative ...
Regards
|
|
|
|
|
I have a project that started out in VS2003. The last build in 2003 was 2.0.20727.42. I had the AssemblyVersion value in AssemblyInfo.cs set to 2.0.*.*. Things worked as I expected.
Now in 2005 I identified the new AssemblyVersion to 3.0.*.*. If I use Environment.Version , I keep getting the version from 2003 (2.0.20727.42) and it is never changing. If I set AssemblyFile, then I can see that value in Application.ProductVersion but a) This is a string I'd have to break down to get the versionning if I was to use it. b) It doesn't auto-increment.
When I did the upgrade from 2003, I created a new project in 2005 and then I used "Add Existing..." to add the forms and User Controls. Did something else get sucked in that is not allowing me to get the correct Environment.Version ?
|
|
|
|
|
I did the same as what I think you have done (i.e., add existing) and it worked fine for me. In fact, I have no version info.
1. Make sure to have the 2003 file set in a different folder than where the 2005 set will be.
2. Create a new project.
3. Add all the existing files (if .resx files having the same name exist, they will be imported automatically).
4. Click "Project" and select the project name (on the 2005 menu)
5. Click "Assembly Information..." (in the Application tab section)
6. Setup your new version info
Worked for me. Hope it works for you.
|
|
|
|
|
When text control in grid is active, esc key does not close form
How to close the form in this case in .NET 1.1 ?
To reproduce:
1. Run the code
2. Click in first row in first column
3. Press esc key
Observed: esc key is ignored
Expected: Esc must close form
using System;
using System.Windows.Forms;
namespace closeissue
{
public class Form1 : Form
{
public Form1()
{
this.IsMdiContainer = true;
this.Load += new System.EventHandler(this.Form1_Load_1);
}
private void Form1_Load_1(object sender, EventArgs e)
{
Form x =new Form2();
x.MdiParent = this;
x.Show();
}
}
public class Form2 : Form
{
public Form2()
{
dataGrid1=new DataGrid() ;
this.form1BindingSource = new System.Windows.Forms.BindingSource();
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.form1BindingSource;
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.form1BindingSource.DataSource = typeof(createdobjectstotshown.Form1);
this.Controls.Add(this.dataGrid1);
this.KeyPreview = true;
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form2_KeyPress);
}
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.BindingSource form1BindingSource;
private void Form2_KeyPress(object sender, KeyPressEventArgs e)
{
Close();
}
}
static class Program
{
static void Main()
{
Application.Run(new Form1());
} } }
Andrus
|
|
|
|
|
Create a cancel button on your form. In the form properties set this button in the CancelButton property.
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Thank you.
My whole form contains datagrid.
I do'nt want to add a button to form.
Thi sis like Excel spredsheet which does not contain buttons inside.
Any idea how to close datagrid with Esc key, without button ?
Andrus
|
|
|
|
|
I'm creating a MONO/.NET 1.1 C# WinForms application.
I need run custom hook code before saving invoices and in other places.
I need to run and change C# scripts in customer site without VCS Express 2005 installed.
Any idea how to implement this ?
Andrus
|
|
|
|
|
Hello everyone,
I'd like to ask if I can colorize specific lines (let's say the firs and the last line) in a RichTextBox control. I'd appreciate any help..
Best regards, and thanks!
.:: Something is Wrong ::.
|
|
|
|
|
Hello!
I have a panel with 2 buttons and it has to be possible for user, resize the buttons.
Do you have some tipps for me?
|
|
|
|
|
YEs, capture mouse movement when the button is down ( or whatever mechanism you want to use ) and set the Size property on the button accordingly.
Christian Graus - C++ MVP
|
|
|
|
|
Here's one rather simple and sloppy method for resizing a single button:
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace CP_CSharp_SizeButton
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && this.Cursor!=Cursors.Default)
{
if (this.Cursor==Cursors.SizeWE)
button1.Width = e.X;
else
button1.Height = e.Y;
}
else
{
if (e.X > button1.Width-5 && e.X < button1.Width+5)
this.Cursor=Cursors.SizeWE;
else if (e.Y > button1.Height-5 && e.Y < button1.Height+5)
this.Cursor=Cursors.SizeNS;
else
this.Cursor = Cursors.Default;
}
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
this.Cursor = Cursors.Default;
}
}
}
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank you, I get your solution
Hello
|
|
|
|
|
hello every one, well I'm making a form in a windows aplication in C#.net 2.0. What I'm trying to do is to present the user with one option on each tab but I want them to go in a sequence. So all I wanna do is that the user should select the value form the first form then press a button to go to the next tab and so on untill he reaches the last tab u knwo. So how can I restrict the user from accessing a tab and to navigate to the next by presin a button or something u know.
thanks in advance.
Rocky
|
|
|
|
|
Rocky71 wrote: how can I restrict the user from accessing a tab
You can cancel the navigation by handling the TabControl 's Selecting event. But imho, you should use a wizard metaphor instead. A tab control is generally intended to allow the user to access any tab at any time. Detracting from this paradigm could cause user confusion.
/ravi
|
|
|
|
|
you know I was also thinking abt using wizards. but I 've a very stupid question commin here how do me make the in windows forms?? actipro wizard is thaat the answer?/ plz tell me abt it
|
|
|
|
|
i m calling a web method through ma client which returns a xmlnodelist but it is not working and returns the following error
To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. System.Xml.XmlNodeList does not implement Add(System.Object).
i cant understand where does this error leads to???
Warm Regards
Bia
|
|
|
|
|
First,
In what point this exception has been thrown?
Second,
from what is looks like in the error itself and in the information from the metadata and http://msdn2.microsoft.com/en-us/library/system.xml.xmlnodelist_members.aspx[^] it looks like XmlNodeList (or the classes it inherit from) doesn't implement the proper interfaces so it could be serialized... and you can't transfer it from your web service to the client...
so it looks like this error leads to finding another way transfering the data
good luck,
Tal Kain.
|
|
|
|
|
Hi,
Can Anyone let me know How I can validate the columns of a datgrid?
Thank you,
Regards,
Deepa
|
|
|
|
|
Validate them? Against what? What kind of validation do you require?
|
|
|
|
|
Hi,
Columns should only numeric characters and restricting special characters.How can I validate my datagrid columns?
Thank you,
Regards,
Deepa!
|
|
|
|
|
Is there any way to do something like this:
StartScreen.mCP.talkTime("#FM", "01", {newINIs, items});
Which is to say passing in an array without actually making the array, or do I need to do it like this:
object[] o = new object[] {newINIs, items};
StartScreen.mCP.talkTime("#FM", "01", o);
Something like the first way would be better more useful, but Visual Studio doesn't like it, so...
- Munty
|
|
|
|
|
Hi.
Try something like this
<br />
StartScreen.mCP.talkTime("#FM", "01", new object[]{newINIs, items});<br />
I don't know if it'll work, but try it. One never know.
ASBESTOS-Greetings
|
|
|
|
|
That worked perfectly.
Thanks
- Munty
|
|
|
|
|
No problem
ASBESTOS-greeting
LiquidE
|
|
|
|