winforms

upload file from window application to Remote Web Server

string filePath = "C:\\test\\564.flv"; try { WebClient client = new WebClient(); NetworkCredential nc = new NetworkCredential(uName, password); Uri addy = new Uri("\\\\192.168.1.28\\Files\\test.flv"); client.Credentials = nc; byte[] arrReturn = client.UploadFile(addy, filePath); Console.WriteLine(arrReturn.ToStr...

2 Controls, 1 event

I have 2 input textboxes that take a host or IP. When the user leaves an input box an event is fired that checks the input to see if it is actually a live computer. The results are then put into the appropriate label. My question is, should I be using separate events for each input box, since they update different labels? Or, can I...

WinForms - DateTimePicker default month selection behavior for Server 2003 vs Server 2008?

Good Afternoon! Has anybody else noticed a change in the default behavior of the "next" and "previous" month arrows in the standard WinForms DateTimePicker control? I have users running on both Windows Server 2003 and Windows Server 2008 R2, and they are reporting that on 2008 (and Vista/Win7), clicking the right or left arrows on the ...

WinForms Mouse Capture

Hi all! I have Windows Forms application and I need to capture the mouse movements outside my window. My simplified code in my window class is: private void ButtonOnClick(object sender, EventArgs e) { Capture = true; MouseMove += OnMouseMove; } private void OnMouseMove(object sender, MouseEventArgs e) { Console.Out.Write("...

Retrieving "invalid" value from a NumericUpDown Validating event

When the user enters a value above numericUpDown.Maximum, the control's value is automatically set to the maximum. I'd like to display a MessageBox when this occurs, but I'm not able to do that because control.Value and control.Text already contain the automatically set value, maximum, when Validating event is raised. private void numer...

Creating a Custom UserControl TestContainer for Visual Studio

I like to use the "UserControl TestContainer" that works great for testing a controls properties during design time. Yet it has limitations. Usually, I just create a Windows Form Application to test the control's run-time interface. It would be nice to combine the two phases. Today, I discovered that the test-container is defined in the ...

Custom DataGridView column sort based on Value not Formatted value

I have a custom DGV cell I'm using to display the contents of MyType objects. To control how they're being formatted I'm overriding the GetFormattedValue() and FormattedvalueType methods of DataGridViewTextBoxCell because in this case I don't want to use the default ToString() method. The problem is that when I do this the DGV is sorti...

How to capture a signature from an ePad in C# - windows forms?

I need to save a signature from an ePad device .. I would prefer to use the Microsoft.Ink InkPicture control but the ePad really zoom zooms the mouse pointer about. The ePad SDK samples didn't compile either. Also, I'm a winforms noob. Is there a certain library or sample code that might be helpful? ...

.Net ListView and System's Icon Size

I have a ListView using the LargeIcon View mode with some 64x64 thumbnails. The problem is that the padding between ListViewItems is somehow based on the system's Icon size value (Display Properties > Appearance > Advanced > Icon). The default for XP seems to be 32 and the ListView and its thumbnails look fine, but with higher Icon size...

Detect if any USB drive is detected or not using WinForm Application

I want to do the following things in my application 1) I want to display whether any USB drive is inserted or not in my application to prompt the user to insert a USB drive. I just want to notify the user if any USB dirve is inserted else prompt him to insert one using a label or something (i want to avoid messagebox as it will keep app...

Something like windows taskbar in c#

Hello I want to simulate something like windows task bar in c#. I want a bar on bottom of a form (i mean mainform) .when i open new form,the form name place on bar and when i open another new form,the new form name place on bar and ... In other hand ,when i click on the form name on bar,that related form be active. What can i do? Thank y...

Folder Browser Dialog.

I am using Folder Browser Dialog in my application to select a folder. Now I want such a thing that in the folder there should be only html files nothing else to be selected. Like if we have open file dialog and only we want to display html file then we use filter property of openfiledialog.So how can I do that in folder browser dialog t...

How Pick a Column Value from a ListView Row - C#.NET

How can i fetch the value 500 to a variable from the selected row? One solution would be to get the row position number and then the CustomerID position number. Can you please give a simple solution. SelectedItems means selected row and SubItems means the column values, so SelectedItem 0 and SubItem 0 would represent the value 500...

Invalid URI: The format of the URI could not be determined.

I keep getting this error. Invalid URI: The format of the URI could not be determined. the code I have is: Uri uri = new Uri(slct.Text); if (DeleteFileOnServer(uri)) { nn.BalloonTipText = slct.Text + " has been deleted."; nn.ShowBalloonTip(30); } EDIT: the content in slct.Text is ftp.jt-software.net/style.css. What gives?...

ListView Control and Details

Hi All, I'm a bit confused by a few tutorials that I read about the ListView. I have a ListView control and on the left hand side should be a name, and to the right of that name should be like another column with some more text in it. For example: ListView: jason blah blah blah item2 more blahs item3 jupiter item4 ...

How can show data from another form

This is basically a tic tac toe game, and I have another form called Winner.cs when a player wins I want it to call the form (this part works) and then I want it to say xWinner.label =b1.text"" + has won the game!. the part I cant get to work is displaying the text in the winners form label. There's an example of a message box that comme...

Why doesn't Win Forms application update label immediately?

I am doing some experimenting with threads, and made a 'control' method to compare against where all the processing happens in the UI thread. It should run a method, which will update a label at the end. This method runs four times, but the labels are not updated until all 4 have completed. I expected one label to get updated about ev...

Preventing ListBox scrolling to top when updated

I'm trying to build a simple music player with a ListBox playlist. When adding audio files to the playlist, it first fills the ListBox with the filenames and then (on a separate thread) extracts the ID3 data and overwrites the filenames with the correct Artist - Title information (much like Winamp). But while the ListBox is being update...

richtextbox font

hi.... I want to change the font color and size for 1 line in richTextBox String [] wo = {"hi","hello","11111","he","she"}; richTextBox1.SelectionFont = new Font("Verdana", 10, FontStyle.Regular); richTextBox1.SelectionColor = Color.Blue; richTextBox1.SelectedText += Environment.NewLine + wo[0]; richTextBox1.SelectedText ...

Dictionary with Exact Same Keys and Values

Hi All I need something like a Dictionary or a SortedList but i keep getting exceptions thrown when it receives two things that are the same... Is there another way around this? Thanks ...