Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

ActiveX control properties missing!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 26 Jul 2004 16:55 GMT
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
"Ying-Shen Yu[MSFT]" - 27 Jul 2004 07:02 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.