In this video we will see the Layout toolbar, which is a toolbar which contains a number of functions that allow us to easily and automatically organize the various controls that are on our Form, or resizing and moving, aligning, etc. .
Thus we see a new project and call it the application layout. Then press the OK button and as usual we see reported in the design, the Visual Basic 2010.
Our window we have to do now is to display this toolbar layout, so we go to the main menu click on View Toolbars, and there appears a list of toolbars that can be added to those already present in the designer.
They are marked with a tick and now there is only so the Standard toolbar.
We must add the toolbar layout, so click on the item layout. Now there appeared in the space of the toolbar, just the toolbar layout that interested us.
Then the button of this toolbar or this we can see that all are disabled because they are all gray.
We can see the difference with the top toolbar, which instead has the colored buttons. This means they are not enabled. These buttons are grayed out because they are related controls are a series of actions that can be performed on the controls on the Form, but not being already then controls all the functions are of course disabled.
To re-enable the buttons, so we have to add some controls on the Forms Take for example a button and the second button, as we did in the previous Button2 extend horizontally so that it is more or less double the Button1.
We can see that if we select the control functions are now enabled. Some features available on this toolbar are applicable only to a control, other functions are applicable to both controls. That is, apply in the comparison between the two checks. If in fact select both controls, here is that some functions are now enabled.
But start from the beginning: we select the first check that Button2. Only these functions are enabled. Let us consider: first the "Centered in the form horizontally. This allows us to center in the area of our window this control. So we do a test: put him in a difficult angle and click on "form in horizontally centered." Expect that changes its position and is aligned horizontally in the form we see that it is just that. To control precisely positioned in the central point we should make a next step and click the button that appears after "Centered in the vertical format. Now the control is exactly the midpoint of the form.
Central point which excludes both the edge of the form, both the title bar, so the location is central to the only gray area.
Now let's see the other two functions that appear after "Bring to Front" "Send to" may in fact happen that two checks are sometimes superimposed on each other for example is superimposed over Button1 Button1. In the event that it wanted instead to be overexposed than Button1 Button2, we should first click on the button "Bring to Front."
Here and above that actually appears Button1 Button2. We can see that completely covers or almost Button2 Button1, Button2 we can bring to the fore always click "Bring to Front."
We returned at about the previous situation. We can bring back respect Button1 Button2 by pressing the other button "Send to Back."
In doing so we find Button1 Featured strictly controls as they were before and then Button1 Button2 Button1 with half of Button2.
We click on that button "Tab Order" shows us the tab order of controls that is the order in which controls are selected the moment when you will repeatedly press the TAB button on this window. So a tab index of zero means that the first check and will receive the focus that is to be activated by opening the window by pressing the tab key the focus will move to the next control. Control with a following that is a tabindex tabindex have it right next Button2.
If we had control under the third rule we have just seen, we're going to take the next tabindex yet since the last inspection. Add a text box this text box will presumably an index three. Indeed it is. We can also change the TabIndex of each control or through the property, and then clicking on Button2 and selecting the TabIndex property, or clicking on this box to select the TabIndex that interests us. Of course, many controls can have the same TabIndex. Now we look at all the functions that regulate the relationship between two or more controls, such as we try to select the button Button2 clicking the left mouse button. Then press the Control key on your keyboard and hold it and click on Button1, to select both controls. We can see that you enable a range of functions on the Layout toolbar. Let's look at the main. "Remove the vertical spacing": They can remove the space between a check of the other vertically so the vertical space between a control to another. In this case, expect that after clicking this button Button1, Button2 and go to join vertically to touch. Let's check and you'd be. The next function allows for a gradual removal of the vertical spacing and then slowly decrease the vertical spacing but did not cancel it immediately see what happens on Button2 begins to rise until the third to fourth this button spacing will not be practically annulled. The next function is used instead of increasing the vertical space, so we can increase the space between these two controls. This button allows us to make the same and the spacing between the three controls. For example, let's add another button named Button3. We expect that the spacing between and among Button1 Button2 and Button3 Button2 and pressing this button showing the same, and indeed it is.
This series of tricks can be done horizontally, for example to place two controls aligned horizontally. Li select either click on Button1, press and hold the Control key and click on Button2 and we see first the "Remove horizontal spacing. Expect that this spacing disappears. Returns control to its original position and click. This function was the decrease in horizontal spacing that will not diminish completely but will reduce the spacing as you click the button. To understand what is the button that will suit other one just to see the color of these squares and move it to the control of these squares will be black that will adapt to what the white squares instead. Indeed, if as in the previous hours diminish the horizontal spacing is Button2, the one with the handles to resize if blacks if we are right and then select Button1 Button2. So we use a different selection than the previous example we see that he Button1 to have these handles will be black so he will adapt to the size of Button1. so reducing the space will move. Same thing for increasing the horizontal spacing the next button, as we have seen, requires the use of three controls that add another button distances than Button1. Expect that this distance is equivalent to the end of this distance here. So we select Button1, Button2, and then click on Button3, press button "Make equal spacing and the spacing is the same now actually we see others and in other functions of the toolbar layout. Select button1 and the Control key and click on Button2. Button2 blacks have the boxes and he will then that will fit. Click on "Make the same." Button2 expect that, exactly what we said we must take the same size scale of Button1. We check if it is true, and that's exactly the case. If we do the reverse, ie click on Button2, Control key and click on Button1 Button1 now is that you will have to resize. Press the button and you are actually expanded. Now there is the drive unit alignment Align the horizontal axis "to align the two controls on the horizontal axis and one of the two controls Button2 feel if it were much higher then the alignment on Button1 ' horizontal position would probably for Button2 on this line. We check and it is indeed the case. This alignment in low alienation on the bottom line of control. alignment than on the top line of control is the same thing vertically with the vertical alignment of controls that "Align right" align the vertical axis on the vertical line left to right and left "Align center" on center line of the control. If we try now to only resize the height of a two button and load up ad'esempio Button1 Button2, Control key, select this button by pressing Button1 Button1 should reflect the height of the height of Button2. and we try to check if it is indeed the case. Even doing the reverse of that selection against the selection of Button2 Button1, Button2 would take the size of Button1. The same applies to the horizontal dimension for which selection of Button1, Button2 control key select, assign the same width and it is Button2 you resize up to horizontal dimensions of Button1.