.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> Windows Application >> Post New Question Subscribe to Interview Questions

How can we auto size a button to fit its text?

Posted By :Subhransu Sekhar Jena     Posted Date :October 30, 2014    Points :40   Category :Windows Application 
The Button control has the AutoSize property, which can be set to true or false. If we set the value of the AutoSize property to true, then the button control automatically alters its size according to the content displayed on it.

You can also find related Interview Question to How can we auto size a button to fit its text?  below: 

Is there a way to set the tab size in the text editor?

Yes, from the standard tool bar select Tools | Options.This will open the Options dialog; select the Text Editor folder, choose a language folder, select Tabs, and set them to your desired setting. (More...)

Does VS.NET support line numbering in its text editor?

Yes, from the standard toolbar select Tools | Options.This will open the Options dialog; select the Text Editor folder, pick the language, and click on the check box for line numbering under the display section. (More...)

How to clear a datagrid on a button click?

You need to Clear the DataSource of the dadaGrid.
So try this: dataSet1.Clear();
dataGrid1.DataSource = dataSet1.TableNameHere.DefaultView;
C#: dataGrid1.DataSource = null;
VB: dataGrid1.DataSource = nothing (More...)

How to add auto increment column in the DataTable?

To add auto increment column in the DataTable, we can set the AutoIncrement property of the DataColumn object as true and specify the seed value after adding that field into the DataTable object.
// create columns for the DataTable

DataTable dTable = new DataTable();

DataColumn auto = new DataColumn("AutoID", typeof(System.Int32));


// specify it as auto increment field

auto.AutoIncrement = true;

auto.AutoIncrementSeed = 1;

auto.ReadOnly = true; (More...)

What's the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created. (More...)

Which of the following is a fixed length DataType?

CHAR Data type is used when the column lenght is known (More...)

How many ways you can display text using Silverlight?

Silverlight supports displaying static pre formatted text that is comprised out of glyph elements and also dynamic text that uses TextBlock. With glyphs, one needs to position the characters individually while TextBlock supports simple layout. (More...)

What is the command name to shrink the data file and log file size in SQL server 2005?

The command name is : DBCC SHRINKDATABASE (Database Name)

This command will shrink the data file and log file size. With this command you can specify that how much percentage space you want to free.

dbcc shrinkdatabase (TempDAabase,10)

This command will free only 10% space. (More...)

Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?

Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();"); (More...)

How FontSize and Font Size is differ in HTML?

font size is an attribute that we used in font tag.
Ex : use in font tag.

Where as font-size is an style property used for controls.
Ex : Font-Size="Small" use for style property For Controls. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend