VB.NET tutorial: Make controls fit to the form


Make Make controls fit to the form

Now if you maximize the form, the items are not smart enough to fit the form. What we want to talk in this page is to help you create a form that its items still stay fit with the form when it is resized for maximum state. To accomplish this task you need the following code that is applied to the Resize event of the form:

 Private Sub Dic_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
'Adjust listbox and textbox heights when the form resizes
If Me.WindowState = FormWindowState.Maximized Then
Lstterms.Height = Me.Height
Txtresult.Height = Me.Height

End If

End Sub

In the next phase, we will talk about cleaning up the objects from the memory when the dictionary is closed.


This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.