|
Array.Sort is what you need.
Christian Graus - C++ MVP
|
|
|
|
|
I'm reading an article now but wan't to know if anyone has done this?
M.E. Guzman
|
|
|
|
|
I'm not sure how else you could do it ?
Christian Graus - C++ MVP
|
|
|
|
|
Certain IO methods, particularly FileInfo.LastWriteTime and FileInfo.Size are excruciatingly slow, especially the first time around.
I know the first time around is slow because the files haven't been cached yet. But it's excruciatingly slow; for a folder of about 1000 files, the cmd.exe dir command can do it in a few seconds whereas it takes System.IO.File and System.IO.FileInfo more than 30 seconds.
I noticed PowerShell has this problem too, since the ls/dir cmdlets use FileInfo as well.
Any ideas on a workaround/remedy?
Thanks in advance,
Rei
|
|
|
|
|
Write the code to do it in C++, perhaps using C++/CLI so you can call it from C#.
Christian Graus - C++ MVP
|
|
|
|
|
Hi,
I am trying to create some custom sound effects to use with the directx 9 managed code for c#. There are some effects that are bundled with the directx SDK but I would like to know how to go about creating my own. I need to know how I can route the audio signal from a secondary buffer through my own effects classes. Has anyone managed to do this? - I can't seem to find any info on the web about creating your own effects using c# with directx. If someone could point me in the right direction I would be very pleased!
Thanks.
|
|
|
|
|
Hi;
I want to know if there is a formula to determine if the user is moving the mouse clockwise or counter clockwise.
If there is could you explain to me?
Thanks
Hadi
|
|
|
|
|
Maybe this[^] will help
led mike
|
|
|
|
|
Calculate the angle for a vector from the center point to the mouse pointer, and watch how the angle changes.
---
b { font-weight: normal; }
|
|
|
|
|
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
|
|
|
|