So I am trying to reduce some coding…so I have a number of windows that all perform similar functionality against various tables in my sqlite db…as I am doing error checking or confirmations or info windows…I am wanting to reuse the same code passing parameters to make this happen. That way I don’t have to copy the same code from window to window to windows basically. So my dialog calls are basically ShowModalWithin(some window) - since I am trying to make this generic I know the name of the window that I would be calling from but not sure how to define the passing parameter. In parenthesis I want to be the ShowModalWindow(some variable name would go here).
Here is what my generic code looks like below…And I know generates a compile error. Any ideas on how to solve/approach this?
Dim d As New MessageDialog //declare the MessageDialog object
dim b As MessageDialogButton //for handling the result
d.Icon = MessageDialog.GraphicCaution //display warning icon
d.ActionButton.Caption = “OK”
d.CancelButton.Visible = False //show the Cancel button
d.Title = “Info”
d.Message = msgTxt '<- msgTxt comes from passed parm.
d.Explanation = “”
b = d.ShowModalWithin(me) //display the dialog in the window