Re: How do I create my own control

From: Dan Artuso (dartuso_at_NOSPAMpagepearls.com)
Date: 12/15/04


Date: Wed, 15 Dec 2004 16:04:17 -0500

Hi Rhonda,
First you have to choose ActiveX Control as the project type.
Did you do that?
If so, you can change the shape drawn by the Shape tool to a circle in the properties window
under the Shape property. You can select from a number of different shapes.

Next, go to the Add-Ins menu and select Add In Manager...
Then highlight "VB6 ActiveX ctl winzard" and then check the Loaded/Unloaded checkbox
under Load Behavior. Click OK

Now the wizard will appear under the Add-Ins menu.
Start it up.

Click through the screens until you get to the "Create Custom Interface Members" srceen.
Click on New
Here I entered CircleColor as the Name and I selected Property as the type.

Click Next
Now you're going to map the property to the back color of the circle.
So, in the left list box select CircleColor and then under Maps To select Shape1 (or whatever you called
the shape) and then select BackColor from the Member combo box.

You can now just click through to the end and read the report it generates.

What I did also (from the UserControl's properties) was to make the back color white with the style transparent.

Give the Project a name and the UserControl as well and then save everything to the directory of your choice.

Now from the File menu select "Make ProjectName.ocx"
This will actually create the binary ocx file.

I usually just put the=m in my system32 directory.

Now, bring up a Command Prompt and type in:

regsvr32 PathToSystem32\NameOfocxFile

in my case it looks like:

regsvr32 c:\winnt\system32\MyControl.ocx

This will register your control.

Now if open up Access and look at all those extra controls you should see yours in there. It will be listed as:
ProjectName.NameOfControl

You can now add it to the form and experiment. Obviously this is a broad topic, but that's it in a nutshell.

-- 
HTH
-------
Dan Artuso, MVP
"Rhonda" <anonymous@discussions.microsoft.com> wrote in message news:048e01c4e2bc$bfe2b010$a401280a@phx.gbl...
> I have VB 6.0
>
> Just opened it for the first time... How do I start the
> Wizard you refer to? And my toolbar has a "shape" icon -
> but I can only draw squares - not circles.
>
> >-----Original Message-----
> >Ideally, VB6.
> >Anything under 5 and I don't think you can create
> controls.
> >
> >-- 
> >HTH
> >-------
> >Dan Artuso, MVP
> >
> >
> >"Rhonda" <anonymous@discussions.microsoft.com> wrote in
> message news:167401c4e2b0$d22184b0$a501280a@phx.gbl...
> >> Being new to VB - this may be a challenge.... I guess
> once
> >> I get the VB-environment going it will be a lot like
> VBA.
> >>
> >> What version of VB should I use? I use MSAccess2000.
> >>
> >> >-----Original Message-----
> >> >No really!
> >> >I started up a new ActiveX Control project from VB.
> >> >I drew a circle on the designer and then used the
> >> Interface wizard
> >> >to map the BackColor to the circle. That's it! The
> >> control was ready.
> >> >
> >> >I was shocked at how easy it was.
> >> >
> >> >--
> >> >HTH
> >> >Dan Artuso, Access MVP
> >> >
> >> >
> >> >"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com>
> wrote
> >> in message
> >> news:8f3vr05jkm1u02n4r8gsr5ivsr7nmgnv7h@4ax.com...
> >> >> On Tue, 14 Dec 2004 18:49:00 -0500, "Dan Artuso"
> >> >> <dartuso@NSpagepearls.com> wrote:
> >> >>
> >> >> >Hi,
> >> >> >It seems I was wrong, it me about 15 minutes to
> create
> >> one :-)
> >> >>
> >> >> Speak for yourself Dan... fifteen minutes for you,
> >> hours for us mere
> >> >> mortals! <g>
> >> >>
> >> >>                   John W. Vinson[MVP]
> >> >>              Join the online Access Chats
> >> >>         Tuesday 11am EDT - Thursday 3:30pm EDT
> >> >>       http://community.compuserve.com/msdevapps
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


Relevant Pages

  • Re: A challenging 3 equations and 3 unknowns
    ... circle using three ultrasonic sensors. ... any case the OP on the plc forum said this must run on a PLC so the ... is used in industrial control systems. ...
    (sci.math.symbolic)
  • Re: Active X specifcation.
    ... COM MVPs accept this definition for an ActiveX Control and we ... stick to the OCX'96 spec with the name change from OLE Control ... Microsoft MVP, MCSD ...
    (microsoft.public.win32.programmer.ole)
  • Re: Why do RCers dislike C/L flyers on the same site.
    ... We have put in a circle at our field here in Lkae ... >> same experience when suggesting C/L flying at an RC site. ... > control line now, along with R/C. ... > I do not want control line flying at our R/C field. ...
    (rec.models.rc.air)
  • Re: Draw an Arc
    ... points on the circle -not the control points. ... full quarter circle is drawn. ... curve in a favourable direction. ...
    (microsoft.public.vb.general.discussion)
  • Re: - How to show AddShape object over Image control?
    ... Dan nous racontait que: ... What I am trying to do is pretty simple - draw a circle on ... Which makes sense, if a control was hidden by a shape, the user could not ... You could use a MACROBUTTON with an image instead of a text invite: ...
    (microsoft.public.word.vba.userforms)

Loading