Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Wednesday, May 25, 2011

VB-7 : Part of an OLE Object

Refer VB-6 : Creating OLE at Design time also.This code links or embeds the complete file.
In case, a part of the file is to be used as an object, the steps involved are as follows:



Here we need two command buttons ,and one OLE ( Once the OLE box has appeared,click CANCEL to remove this dialog box)

A)   Property :
Command button : NAME- Command1 , CAPTION- Use OLE
Command button : NAME- Command2 , CAPTION- Exit
OLE                     : NAME-OLE1



B)   Attaching Code to the Object :
Private Sub Command1_Click()
If OLE1.PasteOK = True Then
OLE1.PasteSpecialDlg
End If
If OLE1.OLEType = 3 Then
MsgBox "Nothing has been copied"
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Back to Home   &  VB

VB-6 : Creating OLE at Design time


Using the “insert Object dialog box” we can insert image,media-clip,charts,word file etc..on design time itself.
We can browse files and can create new one.

Two command buttons ,and one OLE ( Once the OLE box has appeared,click CANCEL to remove this dialog box)

A)   Property :
Command button : NAME- Command1 , CAPTION- Use OLE
Command button : NAME- Command2 , CAPTION- Exit
OLE                     : NAME-OLE1

B)   Attaching Code to the Object :
Private Sub Command1_Click()
OLE1.InsertObjDlg
End Sub

Private Sub Command2_Click()
End
End Sub

This code links or embeds the complete file.(Refer VB-7 : Part of an OLE Object  also)
=========================================================================
Back to Home   &  VB

VB-5 : Phone



Place three images of phone(Click Project -> Components , then select Microsoft Common Control 6.0 ??? ,), one command button and one timer on the form.

A)   Property :
Comman Button : NAME – Command1,CANCEL-True,CAPTION-Exit
Timer                 : NAME – Timer1, INTERVAL-500
Image                 :  NAME-Main, PICTURE-(Browse the picture)
Image                 :  NAME-Ring1, PICTURE-(Browse the picture)
Image                 :  NAME-Ring2, PICTURE-(Browse the picture)

B)   Attaching Code to the Object :
Private Sub Timer1_Timer()
Static pbmp As Integer
Main.Move Main.Left + 15, Main.Top - 6
If pbmp Then
Main.Picture = Ring2.Picture
Else
Main.Picture = Ring1.Picture
End If
pbmp = Not pbmp
End Sub
-------------------------------------------------------------------

Private Sub Command1_Click()
End
End Sub

Correct this output...
 ========================================================================
Back to Home   &  VB