How to remove default focus set on combobox in winform - winforms

In windows form, I have 5-7 combobox on one 3 tab pages of tab control.
This tab control reside in a group box.
There are other two groupboxes containg other text box and listview controls.
Problem is, When defualt load the form control then focus set on combobox and unable to unselect.
Tried by changing property- causevalidation to false but no output.
Please guide.

Add a line on Page Load to set focus on the control you want to focus.
For Ex:
txtName.Focus();
EDIT
Use this
ActiveControl = yourcontrolNameToWhichYouWantToSetFocus;

You can set the TabIndex of the controls, the lowest index will be the first focused. (TabStop should be true)

I you want to set focus to another combobox you should call Select() method.

Related

How do I increase space between Checkbox's text and the checkbox?

I'm working with a .NET WinForms form. I'm adding a new Checkbox control to the layout, but I need its text and checkbox elements to align with existing controls. Is it possible to bump out my Checkbox's checkbox element from its text element? Or am I better off creating a separate Label control?
thanks
Try using the following settings for your CheckBox controls:
checkBox1.AutoSize = false;
checkBox1.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
checkBox1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
You will have to set the location and the size of the control yourself now.
Just create a custom (composite) control by adding a checkbox and a label. set the spacing as per need.

How to reload focus on form controls (dockPanels)

I have one Form with four dockPanels
dock_1
dock_2
dock_3
dock_4
I want to focus on specific dockPanel by changing theirs 'tabIndex'. For dockPanel which should be focused I set tabIndex on 0, rest of dockPanels' indexes I increase.
I need control it inside method to be able trigger changes when I need it. I can set it inside constructor and during form first initialization focus can be set correct but it's not what I need.
The problem is that I can't force realod focus on form so when I change tabIndexes nothing happened.
Do you know how to trigger:
System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.UpdateFocusedControl()
It should reload focus inside the form but I'm not able to trigger it.
I tried solutions similar to: myForm.Select() but without any results.
Thanks
The TabIndex property is not applicable for dock panels.
Use the DockManager.ActivePanel property to get or set the currently active dock panel:
dockManager1.ActivePanel = dockPanel1;
The active dock panel is the one that has focus or contains a control that has focus.
When the active dock panel is changed the DockManager.ActivePanelChanged event is fired.

Make active tab text bold - DevExpress WinForm

I want to make active tab text bold , tabs are DevExpress xtraTabs
So, wherever the DevExpress XTraTabs are used, make the text of active tab bold.
Set this property once and not everywhere.How to achieve this?
You can set the tabcontrol's ApperancePage.HeaderActive.Font.Bold property value to true.

Silverlight 3 Combobox Rollover Behaviour

I have a combo box on a form and when I rollover the combo box with my mouse, the OnMouseOver event causes a graident view to appear. How would I go about ensuring that it doesn't do that. What I want is for the combo box to remain white.
What you need to do is create a new Template for your ComboBox. This is easiest to do in Blend; right click on the control and choose to edit a copy of the template.
You will want to remove the animations from the MouseOver VisualState.

Winform and Tab?

When setting up a Winform with textbox controls, and going to View Tab Order -
how do you indicate when you are done setting tab order and want it to be saved?
Is there any other way to set the Tab Order of the controls on the form?
When you are finished, click the tab order again or press Esc.
You can set the tab order using the Tab Index property either in design mode or at runtime.
To indicate that you are done, hit ESC.
You can change the tab order by setting the TabIndex property on the controls themselves
When you begin setting the tab order you klick the tab order button. When you are done you click it again to disable it.
You can set the tab order number in each controls properties sheet or at runtime via the TabIndex value.

Resources