Two Strings Dialog

Created:2/12/1999
Description:

This sample shows how to create a custom dialog implemented as an in-process server. It can be used to add a two strings from two text boxes. The vb code shows the interface definition for the ITwoStringsDialog, and the implementation of this interface.

How to use:
  1. If the entire Coordinate Geometry sample has been installed using the _INSTALL.BAT skip to step 3.
  2. Register the StringsDialog.dll on your machine. This can be found in the folder ..\..\COGOUtilities\TwoStringsDialog.
  3. Create a new vb exe project and reference StringsDialog.dll. Add a form with two buttons called Command1 and Command2. Add the following code to your form:
    Private Sub Command1_Click()
      Dim pBearDistDial As ITwoStringsDialog
      Set pBearDistDial = New TwoStringsDialog
      pBearDistDial.CheckLabel1 = "No"
      pBearDistDial.CheckLabel2 = "Way"
      If pBearDistDial.DoModal("Mean Parent", "Absolutely Not", "uh-uh", 1, 1) Then
        MsgBox "Take out the garbage"
      End If
    
    End Sub
    
    Private Sub Command2_Click()
      Dim pBearDistDial As ITwoStringsDialog
      Set pBearDistDial = New TwoStringsDialog
      pBearDistDial.CheckLabel1 = "Why"
      pBearDistDial.CheckLabel2 = "Not"
      If pBearDistDial.DoModal("Cool Parent", "Sure", "whatever", 1, 1) Then
        MsgBox "Here are the keys"
      End If
    
    End Sub
     
    

Application:
ArcMap

Requires: StringsDialog registered on your machine.

Difficulty: Intermediate


Visual Basic
File Description
TwoStringsDialog.cls VB class file containing the implementation.
TwoStringsDialog.vbp The project file for the sample sketch tool.
TwoStringsDialog.dll The compiled project.


Key CoClasses: Editor
Key Interfaces: ITwoStringsDialog
Key Members: ITwoStringsDialog::DoModal