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 / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Using ActiveX Controls on VB2005 Form: Where is VALUE property on Microsoft Forms Toggle Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeffrey Christiansen - 02 Jul 2007 02:26 GMT
I have been experimenting with adding Microsoft Forms ActiveX Controls
to a VB2005 Form to be used as a Windows Application (i.e. compiled to
a "*.exe") and can't get them to work properly.

For example I added the ActiveX Microsoft Forms Object toggle button,
however I can't get this simple button to work properly.  The
documentation I found in the FM20.CHM files says the button state can
be determined from its "Value" property, but the property list shown
in VB2005 Studio does not have a "Value" property.  How is the button
state determined and why is there no "Value" property?

This aside, if I put a MsgBox in the MouseClick event it gets
displayed when I start the form (even without a click), but then does
nothing when I actually click on the button.  I've also found I get
different parameters with different attempts to add a toggle button,
such as:

   Private Sub AxToggleButton1_MouseClick
      (ByVal sender As Object,
       ByVal e As System.Windows.Forms.MouseEventArgs)
       Handles AxToggleButton1.MouseClick

   Private Sub AxToggleButton1_MouseClick
      (ByVal sender As System.Object,
       ByVal e As System.EventArgs)
       Handles AxToggleButton1.Enter

   Private Sub AxToggleButton2_MouseUpEvent
      (ByVal sender As Object,
       ByVal e As
AxMicrosoft.Vbe.Interop.Forms.MdcToggleButtonEvents_MouseUpEvent)
       Handles AxToggleButton2.MouseUpEvent

The last one seems to work best, unless I add a MsgBox, but I can't
find any documentation or examples to explain what the correct way to
use Forms controls in VB2005.  What I did find implies that it is
simple drag-and-drop just like other contros.  Can anyone explain the
correct way to add Microsoft Forms controls (and other ActiveX
controls) to a VB2005 application, and why a MsgBox in the Click Event
code causes the control to behave incorrectly.

Thanks.
Jeff C.
mark.milley@binaryswitch.com - 02 Jul 2007 18:19 GMT
Hi Jeff -

You may not want to hear this, but honestly, it may be better in the
long run for you to create your own control than continue forward with
your current COM/ActiveX approach.

Creating controls is a skill that should be mastered anyway - it helps
with code reuse, abstraction, and ecapsulation.

This article should get you moving in the right direction:

       Creating Your First User Control [MSDN]:
http://msdn2.microsoft.com/en-us/library/ttb1w24s(VS.80).aspx

If you want to avoid creating your own control, perhaps you're better
off revisiting your interface approach; you could use radio buttons
just as easily.

Good luck,

-Mark

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.