|
'****************************** Module Header ******************************'
' Module Name: WinForm.vb
' Project: VBCOMClient
' Copyright (c) Microsoft Corporation.
'
' Windows Form hosts ActiveX control.
'
' This source is subject to the Microsoft Public License.
' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
' All other rights reserved.
'
' History:
' * 3/1/2009 1:52 AM Jialiang Ge Created
'***************************************************************************'
Public Class WinForm
Private Sub BnSetFloatProperty_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles BnSetFloatProperty.Click
Dim fProp As Single
If Single.TryParse(Me.TbFloatProperty.Text, fProp) Then
Me.AxMFCActiveX1.FloatProperty = fProp
Else
MessageBox.Show("Invalid FloatProperty value.")
End If
End Sub
Private Sub BnGetFloatProperty_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles BnGetFloatProperty.Click
Dim message As String = String.Format("FloatProperty equals {0}", _
Me.AxMFCActiveX1.FloatProperty)
MessageBox.Show(message, "MFCActiveX!FloatProperty")
End Sub
Private Sub AxMFCActiveX1_FloatPropertyChanging( _
ByVal sender As System.Object, _
ByVal e As AxMFCActiveXLib._DMFCActiveXEvents_FloatPropertyChangingEvent) _
Handles AxMFCActiveX1.FloatPropertyChanging
Dim message As String = String.Format( _
"FloatProperty is being changed to {0}", e.newValue)
' OK or cancel the change of FloatProperty
e.cancel = (DialogResult.Cancel = _
MessageBox.Show(message, "MFCActiveX!FloatPropertyChanging", _
MessageBoxButtons.OKCancel))
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Microsoft All-In-One Code Framework delineates the framework and skeleton of Microsoft development techniques through typical sample codes in three popular programming languages (Visual C#, VB.NET, Visual C++). Each sample is elaborately selected, composed, and documented to demonstrate one frequently-asked, tested or used coding scenario based on our support experience in MSDN newsgroups and forums. If you are a software developer, you can fill the skeleton with blood, muscle and soul. If you are a software tester or a support engineer like us, you may extend the sample codes a little to fit your specific test scenario or refer your customer to this project if the customer's question coincides with what we collected.
http://cfx.codeplex.com/