AllTheTimeWorld.com

csharp controlsImage alignment and text alignment

Image alignment and text alignment

Image and text can be placed in one of 9 positions.

Image alignment and text alignment

Image and text can be placed in one of 9 positions.

Right click the fish and save it to your computer.

Next select the Image property and select the fish from the last lesson. The fish and the words are probably crowded together.


The image and the text can be placed in one of 9 positions. Select the ImageAlign property and select the Top Left corner for the fish. Select the TextAlign property and select the Middle Center.

Save the program as fish and then run it.
fish
You will be happy to note that the fish is now animated.

There are many more properties of the Form and the label that you can experiment with. Before you do, however, you should know that if you change the value of the Forms ControlBox property to false, the user will have to use Ctrl-Break to end the program. From within the C# development environment, you can from the menu Debug, Stop Debugging to stop the program .

Note: The TextBox control has many of the same properties as a Label. A label should be used to display text. The TextBox is used when you want the user to input text.