borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Visual Studio 2005)Next Topic (VB program running in the backgorund) New Topic New Poll Post Reply
AndreaVB Forum : VB General : property page for OCX?
Poster Message
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 160

icon property page for OCX?

anyone know how to make property page for ocx? and on the other hand, can you tell me how can i put common dialog to browse for file in my ocx. for example i want to browse database(Main.mdb). anyone help me!

____________________________
Please help out.

01-11-2005 at 02:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
jdsouza
Level: Protégé

Registered: 29-10-2005
Posts: 7
icon Re: property page for OCX?

'  Package your propertybag file PBFileName with your ocx
'  For the common dialog box control, you have to make a reference to it by adding the control
'  to your list of components.  The file to make a reference to is COMDLG32.OCX
'  You have to package comdlg32.ocx and comdlg32.dep with your application
'  Both should be found in your windows system directory.

Public PB As PropertyBag   '  module level

Public Sub ReadPropBag()
On Error Resume Next
Dim FILNAME As String
Dim vartemp As Variant
Dim byteArr() As Byte

Dim FF As Long
FF = FreeFile

FILNAME = PBFilename  '  Full path to your saved PBfile name
'or you can pass the filename in the sub as Public Sub WritePropBag(PBFilename as string)
Set PB = Nothing
Set PB = New PropertyBag

Open PBFilename For Binary As FF
Get FF, , vartemp
Close FF

byteArr = vartemp
PB.Contents = byteArr
DoEvents
Variable1 = PB.ReadProperty("VName1", "DefaultValue1")
Variable2 = PB.ReadProperty("VName2", "DefaultValue2")
Variable3 = PB.ReadProperty("VName3", "DefaultValue3") ' default values need not be of string datatype.

' Etc
DoEvents
End Sub

Public Sub WritePropBag()
On Error Resume Next
Set PB = Nothing
Set PB = New PropertyBag

PBLic.WriteProperty "VName1", Variable1
PBLic.WriteProperty "VName2", Variable2
PBLic.WriteProperty "VName3", Variable3
' Etc.

DoEvents
Dim FILNAME As String
FILNAME = PBFilename   '  saved filename including an arbitary extension example  .xxt
'or you can pass the filename in the sub as Public Sub WritePropBag(PBFilename as string)
Kill FILNAME
Dim FF As Long
FF = FreeFile

Open FILNAME For Binary Access Write As FF
Put FF, , PB.Contents
Close FF
DoEvents
End Sub

01-11-2005 at 08:18 AM
View Profile Send Email to User Show All Posts | Quote Reply
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 160
icon Re: property page for OCX?

thank u for ur help. but what i want when someone right click in ocx in VB, it will display property pages(1st Pic). and common dialog, thank u for tell me how to used it. i already know how to use it, but i want to use it in ocx(2st Pic). could i do that?
example:
-property pages
i have FlexGrid when i right click it will show (1st pic)


-common dialog
i have Image 1(control in VB) when i scroll property, and i click in picture it will show (2st pic)


more idea please?

[Edited by luckyboy on 02-11-2005 at 03:08 PM GMT]

[Edited by luckyboy on 07-11-2005 at 08:07 AM GMT]

[Edited by luckyboy on 07-11-2005 at 08:11 AM GMT]

____________________________
Please help out.

02-11-2005 at 04:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
jdsouza
Level: Protégé

Registered: 29-10-2005
Posts: 7
icon Re: property page for OCX?

Pictures not come in your post.  Please resend.

04-11-2005 at 05:14 AM
View Profile Send Email to User Show All Posts | Quote Reply
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 160
icon Re: property page for OCX?

i stun with it        . anyidea please   ?

____________________________
Please help out.

27-12-2005 at 02:38 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : property page for OCX?
Previous Topic (Visual Studio 2005)Next Topic (VB program running in the backgorund) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder