|
|
Line 1: |
Line 1: |
| {{Template:APIClass|WeibullEvents Class|WeibullEvents}} | | {{Template:API}}{{Template:APIBreadcrumb}} |
| {{Template:WeibullEvents.Question.Cmt}} | | {{Template:InProgress}} |
| | |
| == Syntax ==
| |
| <ul><li>Question(
| |
| {{APIName|sender}} | |
| {{APIPrefix|As}}
| |
| {{APIName|[[WeibullDataSet Class|WeibullDataSet]],}}
| |
| {{APIName|sMsg}}
| |
| {{APIPrefix|As String}}
| |
| {{APIName|,}}
| |
| {{APIName|Buttons}}
| |
| {{APIPrefix|As}}
| |
| {{APIName|MsgBoxStyle,}}
| |
| {{APIName|Answer}}
| |
| {{APIPrefix|As}}
| |
| {{APIName|MsgBoxResult)}}
| |
| </li></ul>
| |
| | |
| Parameters
| |
| :''sender'': A [[WeibullDataSet Class|WeibullDataSet]] object.
| |
| | |
| :''sMsg'': The main display label.
| |
| | |
| :''Buttons'': The MsgBoxStyle that determines the number and display of the buttons. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxstyle.aspx MsgBoxStyle] for additional details.
| |
| | |
| :''Answer'': The MsgBoxResult that is returned by the prompt. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxresult.aspx MsgBoxResult] for additional details.
| |
| | |
| == Usage Example ==
| |
| | |
| {{APIComment|'Overrides requested. Create a new class, inherit WeibullEvents, and set the dataset's events.}}
| |
| Private Class myEvents
| |
| Inherits WeibullEvents
| |
| Public Overrides Sub Question(sender As WeibullDataSet, sMsg As String, Buttons As MsgBoxStyle,
| |
| ByRef Answer As MsgBoxResult)
| |
| MyBase.Question(sender, sMsg, Buttons, Answer)
| |
| {{APIComment|'<Add additional code here.>}}
| |
| End SubEnd Class
| |
|
| |
| {{APIComment|'Set the new Events class.}}
| |
| WDS.Events = New myEvents
| |
|
| |
| {{APIComment|'Ask a question. Result will be updated in Answer.}}
| |
| WDS.Events.Question(WDS, "Continue?", MsgBoxStyle., Answer)<!--
| |
| {{APIComment|Declare a New class that Inherits from WeibullEvents.}}<br>
| |
| {{APIComment|Override the method.}}<br>
| |
| Private Class myEvents
| |
| Inherits WeibullEvents
| |
| Public Overrides Sub Question(sender As SynthesisAPI.WeibullDataSet, sMsg As String,
| |
| Buttons As MsgBoxStyle, ByRef Answer As MsgBoxResult)
| |
| MyBase.Question(sender, sMsg, Buttons, Answer)
| |
| MessageBox.Show("Additional overridden code here.")
| |
| End Sub
| |
| End Class
| |
| | |
| {{APIComment|Declare the WeibullDataSet.}}<br>
| |
| Dim WDS as New WeibullDataSet
| |
| | |
| {{APIComment|Use the created myEvents class in place of the one created by the dataset.}}<br>
| |
| WDS.Events = New myEvents
| |
| | |
| {{APIComment|Select a message box style. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxstyle.aspx MsgBoxStyle] for additional details.}}<br>
| |
| {{APIComment|Declare a result variable. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxresult.aspx MsgBoxResult] for additional details.}}
| |
| Dim MsgBoxStyle1 as MsgBoxStyle = MsgBoxStyle.OkCancel
| |
| Dim MsgBoxResult1 as MsgBoxResult
| |
| | |
| {{APIComment|Prompts user with "Question1" and returns result in MsgBoxResult1.}}
| |
| WDS.Events.Question(WDS, "Question1", MsgBoxStyle1, MsgBoxResult1)
| |
| -->
| |