ActiveX control properties missing!

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I'm trying to use an OCX control developed in vb6 in my winforms application,
however when I add that control to a form, none of the custom properties that I
wrote will appear in the properties window.

I even created a very simple ocx with one property, and the same thing happened.

What am I doing wrong?

-Mike
 
Hi Mike

I did a simple ocx control using VB6 and put it into a WinForm, it seems
work fine for me. Here is my steps:
1. In VB6, create an "ActiveX Control" Project,
2. Add a string type property using "Tools"->"Add procedure", note you
should declare the getter/setter method in public, so that it could be
visible in other ActiveX control containers.

<code>
Private my_string As String
Public Property Get myString() As String
myString = my_string
End Property

Public Property Let myString(ByVal vNewValue As String)
my_string = vNewValue
End Property
</code>

3. Make it into an ocx file.
4. Open VS.NET 2003 then create a new Winform project,
5. In Form DesignView, right click in the toolbox pane and select
"Add/Remove Items" from context menu. select "COM components" page and
browse to our ocx control, add it onto the toolbox, then drag it onto the
form.
6. If it works correctly, you should see the newly added property in
PropertyPane when you select the control. If you are using Categorized view
in PropertyGrid, it should under "Misc" category.

If you still have problem to see the custom property follow the steps above
or I misunderstood your problem, please feel free to let me know with more
detail information.

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Back
Top