chan_cole

IGetStringDialog

Discussion created by chan_cole on Apr 15, 2010
Hi,
I am trying to use IGetStringDialog so that a user can replace the default string I have automated into a callout balloon ("point of interest").  But, I can't figure out how to replace the default string with pGetStringDialog.value.  I am trying to modify code that I used with a UserForm I created, but it is not working.  Any help would be appreciated.
Thanks,
Chandler


Here is the part I am trying to modify.

Dim EP As IElementProperties3
Set EP = pElement
     EP.Name = "Pt_of_Interest"
                   
Dim pGetStrDlg As IGetStringDialog
Dim pbOK As Boolean
Set pGetStrDlg = New GetStringDialog
    pbOK = pGetStrDlg.DoModal("What is this Point to be Named", "Name:", pTextElement.Text, Application.hWnd)
       
If pbOK Then
        Dim pActiveView As IActiveView
        Dim pGraphicsContainer As IGraphicsContainer
        Dim updtxt As String
       
             updtxt = pGetStrDlg.Value
      
        Set pActiveView = pMxDoc.PageLayout
        Set pGraphicsContainer = pMxDoc.PageLayout

        ' Part 2: Add the title.
             pGraphicsContainer.Reset
        Set pElement = pGraphicsContainer.Next

        Do While Not pElement Is Nothing
            Set EP = pElement
            If Trim$(EP.Name) = Trim$("Pt_of_Interest") Then
                Set pTextElement = pElement
                     pTextElement.Text = updtxt
                Exit Do
            End If
            Set pElement = pGraphicsContainer.Next
        Loop

        pGraphicsContainer.AddElement pTextElement, 0
        pMxDoc.ActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
    Else
End If

Outcomes