Results 1 to 5 of 5

Thread: how to make ocx simple example please

  1. #1

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    how to make ocx simple example please

    il like to know how to make ocx ,,, few examples will be great to learn from , how to make ocx files then use them please anyone

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: how to make ocx simple example please

    The Creating an ActiveX Control chapter teaches you how to build a simple ActiveX control.


    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: how to make ocx simple example please

    Open VB6, Create New Project, Choose ActiveX Control.
    There is also a wizard to help you link properties of controls added to your control.

    If you want a few examples then you should really try searching, I'm sure there are 100s of them available

  4. #4

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: how to make ocx simple example please

    thanks ladies and gents

    ahh so simple basic understand what i seen is making ocx it acts as a form or a module am i correct

    i opened form control like u said @datamiser and i am able to add buttons etc etc after tht compile it then in fresh project
    add that ocx as reference then call out commands to that ocx ? is this right
    Last edited by ladoo; May 16th, 2013 at 12:18 PM.

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how to make ocx simple example please

    Yes, that is correct.

    A good way to make an OCX is to make it as part of your normal project. Then VB auto includes it as part of the tool box. This way you can modify you OCX code to get it to work correctly with your normal projects that uses the OCX. When you have perfected your OCX you can save it as an OCX file to be used with other projects. So, instead of opening VB6, creating a new project and selecting ActiveX Control you have your existing project and on menu bar click on Project then click on User Control. This open up a dialog box which you will select User Control (the icon on the left side). This opens up a window with a blank user control Form. Add you controls and your code then test it with your current project


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width