WeibullDataSet.Question

From ReliaWiki
Revision as of 23:45, 16 August 2016 by Kate Racaza (talk | contribs)
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.WeibullDataSet Template:InProgress


Occurs when an answer to a question is required. Displays a message box with yes and no options.


Remarks: To hide the messages or write your own code for the event procedure, set the UseEvents property of the object to True. The event is raised by the class methods.

Syntax

_Question(msg, Buttons, ByRef Answer)

Parameters

sMsg

Required. String. The message to display.

Buttons

Required. The buttons to display when calling Visual Basic's MsgBox function. Can be any MsgBoxStyle constant (see Microsoft's reference documentation for this enum).

Answer

Required. Indicates which button was pressed on a message box returned by Visual Basic's MsgBox function. Can be any MsgBoxResult constant (see Microsoft's reference documentation for this enum).

Example

The following example provides a simple demonstration on how to customize the event procedure.

VBA

 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    Set wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, analyze a data set with a single data point. 
    Call wds.AddFailure(100, 1)
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_Question(ByVal msg As String, _
                          ByVal Buttons As Microsoft_VisualBasic.MsgBoxStyle, _
                          Answer As Microsoft_VisualBasic.MsgBoxResult)
   '<Add code here to handle the event.> 
    Call MsgBox (msg, vbYesNoCancel)
 End Sub
VB.NET

 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, analyze a data set with a single data point. 
    wds.AddFailure(100, 1)
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_Question(msg As String, Buttons As MsgBoxStyle, _
                          ByRef Answer As MsgBoxResult) Handles wds.Question
   '<Add code here to handle the event.> 
    MsgBox (msg, vbYesNoCancel)
 End Sub