winforms

how to force client(winform) application to use NTLM when calling web services

Hi, I have a winform application calling web services hosted in IIS, by default, the client app will use Kerberose for authentication to IIS, and it failed for some reasons。 But the same app works fine at another PC(with different user login), and I found it is using NTLM by checking the IIS server event log. is there anyway we can cha...

Programatically Change the tab order Winforms

Hi Geeks, Don't know if i missed a minor property or method, or if its not possible at all, how do i programmatically re order the tabs in a tab control. i need to sort the tabs depending on some conditions. if its possible to do the reordering through the designer i guess we must be able to do it thorugh code at runtime too??/ thanks...

DataBinding and ErrorProvider - How to provide custom error messages?

We use BusinessObjects, implementing IDataErrorInfo and IEditableObject. BindingLists with those Objects are added to BindingSources, those are used to bind UserControls and DataGrids on the forms (WinForms). The BindingSource is additionally set as DataSource to the ErrorProvider of the form. We do use currently TextBoxes for Propertie...

Mulitiple lines in a cell in a datagrid view

Im using c# .net.. in that im working with windows form application i have a datagrid view with two columns. the first column is readonly and the other is editable. now i want every cell of the second column to support for mulitilines in each cell. i want to press enter key and come to the next line in the same cell. But now if i pre...

Displaying local images in the web browser control

Hi, I am writing a Windows Forms application and am creating a report for users to view in the webBrowser control. The problem is that it does not seem to display an image which is situated on my local hard drive, it just display the "broken image" red cross symbol. The path of the image is correct and when I view the source code of the...

How to retarget the scroll wheel in VB.Net?

I have a form in VB.Net with Autoscroll enabled and several ComboBoxes within it. When I click on a ComboBox, I can use the mouse wheel to scroll through options, but I cannot deselect the ComboBox (by clicking off it on a blank portion of the parent form) in order to return to scrolling the parent form. This makes navigation in the form...

WinForms dynamic listbox

What I wanted to do was create a listbox from a delimited text file. The listbox would populate X # of rows based on the rows of the text file. And the listbox would have 3 columns, each being populated from a specific delimiter. Is this possible in C#? Any starting point would be great! Hmm, i need to work on my explaination skil...

Displaying Fields (and/instead of Properties) in a PropertyGrid

I'd like to use a PropertyGrid to manipulate the data on some objects, however these objects don't have properties, they have fields. Thus a property grid doesn't display them (high five MS!) Before anyone posts "just use properties": I can't at the moment.. these objects are DTOs and are used to send data to a VB6 Interop dll, thus all...

Remove ToolStrip Padding to comply with Fitt's Law

I have a maximized Form with a ToolStrip docked to the right border. Its Padding is set to 0. According to Fitt's Law, it would be nice if the user was able to click the ToolStripButtons at the screen edge. However, the rightmost pixel is not clickable, my button reacts only when I move the cursor one pixel to the left. So how can I fix ...

Sorting a GridView

Hi, I have a question regarding GridView windows forms control. As a datasource, I am using a DataTable object. When the grid view is sorted, the DataTable's row indices are not sorted. In this way, when accessing the DataTable using indices from GridView, I get the unexpected rows. How can this situation be handled? ...

Winform User Settings - Allow multiple choice values at Runtime

I created a simple User Settings Dialog by binding the Property.Settings to a PropertyGrid. This works like a charm but now I would like to allow only certain choices for some values. I have noticed that some Types will give a dropdown of possible choices. This is what I am shooting for but for, say, Strings. Example, one of the ...

How to double click a splitter view to resize the width

I have a form that looks a lot like Windows Explorer. On the left side I have a tree view control and on the right a regular panel. I want to have the ability to double click the splitter view to resize based on the width of the longest label in the tree view. Does anyone know of a good way of doing so? My guess is that I would check...

Are Inherited Forms And/Or Inherited Controls possible in Managed C++

Hello everyone The question is actually pretty self explanatory but I will further clarify it. I am building a simple application to show a load [file] for 5 different types of [files]. So all these 5 forms will have similar GUI elements such as a listbox and a load button with a small textbox/label to show the summary of the [file]'s ...

Printing From WebBrowser control prints to wrong printer after setting default

I have a WebBrowser control in a VB.NET WinForms app. I am able to set the default printer from code and print without prompting the user. However, there is also a print button that shows the PrintDialog. If this action is done first the page will print. Then if I try to programmatically print later (again setting the default printer...

How to draw onto a PictureBox image when control resizes?

I am using the pictureBox_Paint event to try and draw an overlay onto the image in a PictureBox. This is working fine until I resize the PictureBox (set to use SizeMode.Zoom), when I do this the overlay graphic is drawn off position by the margin between the image and the edge of the PictureBox. I guess I need to use the ImageRectangle ...

How does the Control class, provide the ForeColor, BackColor and Font default values?

I know that component-model indicates whether a property has a default value or not, by means of ShouldSerializeValue method of PropertyDescriptor. The base windows-forms Control class, has some properties like ForeColor, BackColor and Font, that defaults to the same value of the parent, but I could not find any TypeDescriptor or Proper...

Keystrokes in Winforms app causing window to close unexpectedly

I have a strange issue that has arisen recently: Whenever I enter text, even a single character, into a textbox in any Form in my application it causes the form and its parent to close. I've checked for the following so far: Errant/mis-assigned event handlers that may be interpreting a keystroke as a Form cancel I am using keypreview ...

C#, Windows Forms, and Application.Run()

Hi, when I call Application.Run() on a form, this command halts the program until the form is closed, it seems. Is there another command I can use to create the form without halting the program? Thanks ...

Cross-thread Winforms control editing

Hey, how can I edit the text in a windows form element if the code that is editing the text 'belongs' to a seperate thread from the one that contains the windows form? I get the exception: Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on. Thank you. ...

Inherited properties aren't bound during databinding

I have two interfaces, IAuditable and ITransaction. public interface IAuditable{ DateTime CreatedOn { get; } string CreatedBy { get; } } public interface ITransaction : IAuditable { double Amount{ get; } } And a class that implements ITransaction, call Transaction. public class Transaction : ITransaction{ public ...