Top 100+ Windows Controls Interview Questions And Answers
Question 1. How Can We Auto Size A Button To Fit Its Text?
Answer :
The Button control has the AutoSize assets, which can be set to real or false. If we set the price of the AutoSize belongings to actual, then the button manipulate mechanically alters its size consistent with the content displayed on it.
Question 2. How Can We Display An Icon Or A Bitmap Image On The Button Control?
Answer :
The Button magnificence incorporates the Image belongings, which is used to set an photograph on the Button control. We also can set the alignment of the photograph via the use of the Image Align property of the Button magnificence.
Programmable Logic Controller (PLC) Interview Questions
Question three. How Is Anchoring Different From Docking?
Answer :
Docking refers to attaching a manipulate to either an edge (top, proper, backside, or left) or the consumer place of the figure manage. On the opposite hand, anchoring is a technique in which you want to specify the space that every fringe of your manipulate keeps from the rims of the discern manipulate.
Question four. How Can You Programmatically Position The Cursor On A Given Line Or On A Character In The Richtextbox Control In C#?
Answer :
The RichTextBox manipulate contains the Lines array belongings, which presentations one item of an array in a separate line. Each line entry has a Length assets,
which may be used to appropriately position the cursor at a man or woman, as proven inside the following code snippet:
private void GoToLineAndColumn(RichTextBox RTB, int Line, int Column)
int offset = zero;
for(int i = zero; i < Line -1 && i < RTB.Lines.Length; i++)
offset += RTB.Lines[i].Length + 1;
RTB.Focus();
RTB.Select(offset + Column, 0);
Control Systems Tutorial
Question 5. What Is The Difference Between The Windows Default Location And Windows Default Bounds Properties?
Answer :
The Windows Default Location assets makes the shape to begin up at a area decided on by means of the running system, but with internally exact size. The Windows Default Bounds belongings delegates each length and beginning role selections to the working system.
DCS(distributed control system) Interview Questions
Question 6. What Is The Function Of The Checkstate Property Of The Checkbox Control?
Answer :
The CheckState belongings receives or units the state of CheckBox.
If the ThreeState property is about to fake, the CheckState property price can simplest be set to CheckState.Indeterminate in code and now not through user interaction.
Checked - The CheckBox presentations a test mark. The manipulate appears sunken.
Unchecked - The CheckBox is empty. The manipulate appears raised.
Indeterminate - The CheckBox shows a take a look at mark and is shaded.
Question 7. Differentiate Between A Textbox Control And Richtextbox Control?
Answer :
The TextBox manipulate is an input manipulate, which permits a person to go into text to an utility at runtime. By default, it allows only unmarried line textual content; but, you can change its assets to just accept the multiline text in addition to scroll bar also.
The RichTextBox manipulate is just like the TextBox manipulate with the difference that it permits the person to layout its textual content additionally. You can format the textual content in various methods, along with formidable, italic, and underlined as well as trade its color and font. You can keep your RichTextBox fee to a RTF (Rich Text Format) report and load value of RTF report to the RichTextBox control.
Control M Interview Questions
Question eight. Describe The Tooltip Control. How Can You Associate It With Other Controls?
Answer :
The ToolTip control generates a small pop-up window with explanatory textual content for an detail It is displayed while the user pauses the mouse for a certain length over an detail/manipulate. Tool recommendations offer a quick help to user to understand approximately that detail. To associate a tool tip with different manipulate, you need to enforce the SetToolTip() approach.
Question 9. Define The Trackbar Control?
Answer :
The TrackBar control, also known as the slider manipulate, works as a navigator to display a large amount of information or for visual adjustment of numeric putting. There are components in a TrackBar control - thumb (also referred to as slider) and tick marks. The thumb element acts as a slider. You can adjust the thumb component the usage of the Value property. The tick marks are visual signs which might be spaced at regular periods.
8051 Microcontroller Interview Questions
Question 10. How Does An Mdi Form Differ From A Standard Form?
Answer :
An MDI form closely resembles a widespread form with one essential distinction-the patron vicinity of an MDI shape acts as a box for other kinds. It means that an MDI form, also called an MDI determine form, can show MDI child bureaucracy internal it.
Question eleven. Write A Method To Get Only The Name Of A File From The Complete Path String In C#?
Answer :
Use a FileInfo magnificence and instantiate its object with the overall direction because the constructor argument and then honestly name the FileInfo.Name file and you may get simply the name of the record.
Controller Area Network (CAN bus) Interview Questions
Question 12. How Do You Retrieve The Customized Properties Of A .Internet Application From The Xml .Config File?
Answer :
Initialize an example of the AppSettingsReader magnificence. Call the GetValue() technique of the AppSettingsReader class, passing within the name of the belongings and the kind expected. Finally, assign the result to the appropriate variable.
Programmable Logic Controller (PLC) Interview Questions
Question thirteen. What Is The Difference Between A Toolstrip Drop-down Button And A Toolstrip Split Button?
Answer :
The difference between a toolstrip drop-down button and a toolstrip cut up button is that a toolstrip split button is a aggregate of two controls - a push button and a drop-down button; while, a toolstrip drop-down button is a single control.
Question 14. How Would You Create An Ellipse, Which Is A Non- Rectangular Window?
Answer :
Open a new Windows form, which is by means of default square in layout and then set the TransparencyKey assets to the equal value as BackColor, with the intention to efficaciously make the background of the form obvious. Then, set the FormBorderStyle assets to FormBorderStyle.None, which eliminates the contour and contents of the shape.
Question 15. What Is The Function Of The Sizemode Property Of The Picturebox Control?
Answer :
The SizeMode assets determines how the picture can be displayed in the PictureBox control. The following 5 enumerations are used to set the fee of the SizeMode assets:
Normal - Represents Standard photograph field conduct (the higher-left nook of the image is placed at upper-left in the picture box)
StretchImage - Displays photograph according the PictureBox length
AutoSize - Increases or decreases the photograph size routinely as per the real length of the PictureBox manipulate.
CenterImage - Displays the photograph inside the middle if it is smaller than the PictureBox manipulate; otherwise, the middle part of the image is positioned inside the PictureBox manage and its out of doors edges are clipped
Zoom - Helps in stretching or shrinking the picture in order that it fits the PictureBox control, via retaining the element ratio of the picture.
Control Systems Interview Questions
Question sixteen. How Can You Prevent Users Of An Application From Editing The Text In The Combobox Controls In .Internet four.Zero?
Answer :
The ComboBox magnificence contains the DropDownStyle assets, that is used to define the display fashion of the gadgets within the ComboBox manage. The DropDownStyle assets accepts a price from the ComboBoxStyle enumeration, which contains three contributors to define the patterns for the items: Simple, DropDownList, and DropDown. The DropDownList fee of the ComboBoxStyle enumeration is selected to set a ComboBox control as non-editable by means of customers, as shown in the following code snippets:
Code for VB:
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Code for C#:
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
Question 17. How Can You Place A Border Around A Picture Box?
Answer :
The PictureBox manipulate gives the BorderStyle assets, which can be set to define the fashion of its border. This belongings can receive any of the 3 values from Fixed3D, FixedSingle, or None. These homes can be effortlessly set through code or via the Properties window of the Visual Studio IDE.
Question 18. How Do We Format Numbers, Dates, And Currencies In A Text Box?
Answer :
Each type has a ToString() method which could used to layout date, currencies, and numbers. You also can use the String.Format() approach to format this stuff as nicely. To layout dates, use the ToString() member of the DateTime kind.
DCS(dispensed manage gadget) Interview Questions
Question 19. What Is The Use Of The Panel Control? Does It Display At Runtime?
Answer :
Panels acts as a box to institution other controls. It is an crucial control, while you want to expose/hide a set of controls and relocate some of controls concurrently.
When you generate a brand new manage at runtime, it works as a container manipulate. As we recognise, it's far a container control; consequently, it isn't displayed at runtime.
Question 20. What Is The Use Of A Toolstrip Container?
Answer :
A toolstrip field is used to incorporate controls, inclusive of ToolStrip, MenuStrip, and StatusStrip, so that those controls can be docked and moved on the run time.
Question 21. What Is The Importance Of A Button Control?
Answer :
A Button control is an crucial Windows manage, which gives the most not unusual way of creating and handling an event inside the code with the help of its Click event.
Question 22. What Is The Use Of A Timer Control? Can A Timer Control Pause?
Answer :
The Timer control is a mechanism to carry out an iterative assignment at a particular time interval. You can not pause it because it could only begin and prevent.
Question 23. What Is Die Difference Between A Checkbox Control And A Radiobutton Control?
Answer :
A CheckBox manipulate is rectangular formed; whereas, a RadioButton manage is round in shape. Moreover, you could choose multiple CheckBox manipulate from a set of CheckBox controls; while, you may pick out most effective a unmarried RadioButton manipulate from a collection of RadioButton controls.
Question 24. What Is The Difference Between A Menustrip Control And A Contextmenustrip Control?
Answer :
The difference between a MenuStrip control and a ContextMenuStrip manipulate is that a MenuStrip control is related to the Windows Form; while, a ContextMenuStrip control is associated with a control, which is brought to the Windows Form.
Control M Interview Questions
Question 25. What Are The Values That Can Be Assigned To The Dialogresult Property Of A Button Control?
Answer :
The DialogResult belongings of a Button control can be assigned a price from the DialogResult enumerations, which can be as follows:
Abort-Returns Abort
Cancel-Returns Cancel
Ignore-Returns Ignore
No-Returns No
None-Nothing is back from the conversation container
OK-Returns OK
Retry-Returns Retry
Yes-Returns Yes
Question 26. Why Do You Require User-described Controls?
Answer :
User-defined controls are specifically beneficial in situations in which you want to enhance the functionality of an present manipulate.
Question 27. Is It Possible To Enter More Than One Line In A Textbox Control?
Answer :
Yes, it's miles viable to go into a couple of line in a TextBox control. To do that, you need to set the Multiline assets of the TextBox manage to True. You can set this property at design time as well as runtime.
The syntax to set this belongings at runtime is as follows:
Textbox1.Multiline = authentic;
8051 Microcontroller Interview Questions
Question 28. How Can You Enable A Text Box To Change Its Characters Format, So That Users Can Enter Password?
Answer :
You can set the PasswordChar property of the TextBox magnificence to True to allow it to just accept passwords. The code to exchange the PasswordChar belongings of the TextBox class is given as follows:
textBox1.PasswordChar = '*';
Question 29. What Does The Tick Frequency Property Of The Trackbar Control Do?
Answer :
The Tick Frequency property receives or units a fee that specifies the gap between ticks. By default, the gap between ticks is 1.
Question 30. What Is The Difference Between The Panel And Groupbox Control?
Answer :
The Panel and GroupBox controls both can be used as a field for different controls, along with radio buttons and test field. The predominant differences among a Panel and a GroupBox manipulate are as follows:
Panel does now not show captions, while GroupBox do
Panel has scrollbar, even as GroupBox does not
Question 31. What Is The Difference Between A Listbox Control And A Combobox Control?
Answer :
With a ListBox control, the person can most effective make an expansion from a list of objects; while, with a ComboBox manage, the consumer could make a selection from the listing of items in addition to can add custom access and choose the equal.
Question 32. What Is The Maskedtextbox Control? What Does The Mask Property Do?
Answer :
The MaskedTextBox control is an improvement of the TextBox control. It forces the consumer to provide the proper enter, which is special through the Mask property. In different phrases, it prevents the user to offer any invalid enter to an utility. The Mask property gets or units the input type to the MaskedTextBox control. There are many integrated codecs for the Mask property, along with phone no., short date, time, zip code, and custom.
Question 33. How Can You Adjust The Height Of A Combo Box Drop-down List?
Answer :
You can manipulate the height of a combination field drop-down list via putting the MaxDropDownItems assets of the mix container. The MaxDropDownItems belongings sets the maximum number of entries with a view to be displayed via the drop-down list.
Controller Area Network (CAN bus) Interview Questions
Question 34. How Can You Enforce A Text Box To Display Characters In Uppercase?
Answer :
The TextBox magnificence consists of the CharacterCasing belongings, that's used to specify the case of the content material for a text field. This belongings accepts a value from the CharacterCasing enumeration of .NET Framework. The participants specified in the CharacterCasing enumeration are Lower, Upper, and Normal. You can pick out any person of these enumerations as a cost for the CharacterCasing assets of a exact text field, as proven inside the following code snippet:
textBox1.CharacterCasing = CharacterCasing.Upper;
Question 35. How Can We Disable The Context Menu For A Textbox Control?
Answer :
The TextBox elegance incorporates the ContextMenuStrip belongings. When we set this belongings to a dummy instance of the ContextMenu magnificence, the TextBox manage is unable to provide any context menu on the right-click of the mouse.
Question 36. What Is Use Of The Dropdownstyle Property Of The Combobox Control?
Answer :
The DropDownStyle belongings changes the fashion of the ComboBox control. It consists of Simple, DropDown, and DropDownList as its values. When you choose Simple, the listing of items are displayed as a ListBox manipulate. When you pick DropDown, the listing is displayed in a drop down fashion. When you select DropDownList, the listing displayed in a drop down fashion and you can't edit its textual content.
Control Systems Interview Questions
Question 37. What Is The Difference Between Pixels, Points, And Em's When Fonts Are Displayed?
Answer :
A pixel is the lowest-resolution dot that the laptop reveal supports. Its size depends on user's settings and the scale of the screen. A point is usually 1/seventy two of an inch. An em is the number of pixels it takes to display the letter M.

