Frame,Image and Picture Control in Visual Basic 6.0


A frame is an object that provide a visual an functional container for controls.it is an object that has solid border around it and a caption at the top.You  cannot  just drag an option button over a frame to add it to the frame.Instead,you must actually draw the option button on the frame. This mean you cannot draw an option button in a frame using the shortcut of double-clicking the control in the toolbox.

Image Control is another control that handles images and pictures.It functions almost identically to the picture box.However,there is one major difference,the image in an Image Box is stretchable,which means it can be resresized.This feature is not available in the Picture Box.Similar to the Picture Box, it can also use the LoadPicture method to load the picture.For example,the statement loads the picture “winter.jpg”: into the image box.

1.Start -> program-> Microsoft Visual Studio 6.0 -> Microsoft Visual Basic 6.0

2. Visual Basic load and appears on your screen.

3.Choose Standard Exe. From dialog box.

4.Add Frame1 ,Command1 button ,one Picture control and one Image control  from toolbox place left side on the visual basic screen.

5.Add two option button option1 and option2.

6.Set the properties of Frame1 ,Command1 button , Picture control and Image control from the properties window.

7.After you click on code window button from the project window.Code window is open.

8. First you select the object from object drop down list writ code here.As shown in figure below.

9. When the form is load option1 and option2 is false.Click on option1 button the Image is show in Image1 Box and when you click on option2 Button then picture is show in Picture1 Box.

10.When you click on picture1 then message box is show.

10.When you click on Command1 Button then form is exit.

Comments are closed.