winforms

Create a virtual directory in iis 6 programatically using vb.net as unprivileged user

I'm trying to write an application that will allow a non-administrator user to create virtual directories in IIS6. I've tried numerous different ways of impersonating a administrative account but nothing seems to work to create the virtual directory. Here's some of what I've tried: dim sDirPath as string = "IIS://remotehost/W3svc/1/ro...

Implement Date Time Picker functionality with MaskedTextBox. Validation done with RegEx

I am trying to create a Custom control specifically for my application which would be using maskedTextBox to restrict input data entered. Now i want to implement this in C#. class CustomDateMask:System.Windows.Forms.MaskedTextBox this.Mask = "00/00/2\000"; // For year 2000 and above, date format is "dd/mm/yyyy" this.ValidatingType = ...

How to fill WebBrowser TextBox's?

I want to log on to this site with my company's user and password from a winforms application, I am displaying the page on a webBrowser control, any Ideas? ...

c# defer form updates

Is there a way to defer a form from updating/repainting while manipulating controls? Edit: I am using TableLayoutPanel control on my form, and I want to remove/add different user controls into different cells of the table dynamically at runtime. when I do this the screen update is too slow, and there is some blinking action happening....

C# user controls custom events

Is there a way to give a User Control custom events, and invoke the event on a event within the user control. (I'm not sure if invoke is the correct term) public partial class Sample: UserControl { public Sample() { InitializeComponent(); } private void TextBox_Validated(object sender, EventArgs e) { ...

Paged Custom ComboBox

I would like to have some sample code on how to do a paginated ComboBox. My data consist on 1300+ items. When the user clicks the combo box arrow, the combobox will display display 25 (page size configurable) items at the time with arrows up/down (depending on page location) so that the user can request the previous/next page. The data i...

Combobox selection control not coming out

Hi, I'm working with winforms comboboxes. When I select any item in combobox I've raised an event. But control can not come outside. When I scroll the mouse the selected event changing every time. how to prevent this? ...

Is there any way to load all UI controls before displaying? C# winform

I have a complicate win form with lots of controls and bulky repaints, controls resizeing and positioning according to user screen, this causes the form to be shown while doing some rendering and repainting. Is there any way to load UI and prepare it before displaying??I mean showing final UI after the whole repainting events done. I...

C# DataGridView Adding a Row - When validating, how do I know the row is new and not yet committed?

I have a client having a problem with a DataGridView in a Windows app. They are calling the CellValidated event, but they want to have different validation for the cell if it is in a row that is already committed back to the datasource than if it is a row that is first being added (and not yet committed (the user hasn't left the row yet...

List of notices, which control is best choice?

I want to use a control to notice users what are happening and what've done. It's like a multiline textbox, each line contains a notice, such as: Connecting to database...done Current datetime: Inserting data into database 10/1000...done Inserting data into database 20/1000...done ... Inserted data into database Current datetime: I t...

calling one child form from another child form in c#

i have 3 forms: FormA ,FormB and FormC of which FormA is mdiParent form and form B and C are child forms. i write the following code in FormA load event. private void frmMain_Load(object sender, EventArgs e) { formB.MdiParent = this; //formB is instance of FormB formC.MdiParent = this; //formC is instance of FormC ...

How can i generate GUID for a string values?

Hi I have a problem for generating GUID for strings. How can we do that? Example- GUID g= New GUID("Mehar"); How can i get the guid for "Mehar". I am getting an exception? Regards mehar ...

Exception in Custom Action during RollBack

In custom action I override following function and got exception in rollback case... "savedState dictionary does not contain the expected values and might have been corrupted ". Is there any other way to rollback ? protected override void OnBeforeInstall(System.Collections.IDictionary savedState) { try ...

Resizing image programmatically in C#

Possible Duplicate: Resize an Image C# How can I programmatically resize an image in C# so that it'll fit in a winforms control? ...

Get a Unique ID for a Hard disk attached to a PC in .net

As the question states I need some way of getting a unique ID for each of the drives attached to my PC. The reason behind this is that if i store the location of a file in a DB and I want to retrieve it at a later stage I wont always get the file since the drive letters change depending on the number of drives plugged in. ...

How do I display an MFC control in a windows forms application?

I'd like to create a windows forms control which shows an MFC control such as CIPAddressCtrl, with a working Text property and TextChanged event. How do I display an MFC control in a windows forms application? I'm happy to use C++/CLI if necessary. NOTE: I'm not asking how to create a brand new windows forms control; I want to host a ...

How do I paint the same area with different set of controls?

I'm using Winforms/ C# .NET. In the ToolStrip I've different buttons, each should take us to a different page. (I don't know what term should I use for this.) I'm unable to express it clearly. The closely related software that depicts what I want is ccleaner see image here: http://i.imagehost.org/0569/cc.gif on selection, of each ta...

Visual Studio 2008 Form Inheritance and Generics Failure to load

Given the following inheritance tree: I have a public class BaseForm : Form This is the base form for all WinForms in the project (or most) and contains some basic stuff. Later in time, when Generics came, I created a public abstract partial class GenericObjectListBase<T> : BaseForm And finally, I specialized that one with a: ...

Why does a form displayed by PowerShell sometimes not show up?

When I create a form (window) in PowerShell, I can usually display the form using .ShowDialog(): $form = New-Object System.Windows.Forms.Form $form.ShowDialog() .Visible is set to False before and after .ShowDialog(). But when I do a .Show() nothing is displayed on the screen: $form.Show() And .Visible is now set to True (presumab...

Draw border around a Control on Button_Click

When a user clicks my Validate Button (in my C#, WinForm, .net 3.5 app) I would like to draw a border around a certain control if it is empty. Say a textbox that is named tbxLastName I thought I needed to do something like this --> ControlPaint.DrawBorder(Graphics.FromHwnd(this.Handle), tbxLastName.ClientRectangle, Color.Firebrick...