Getting access to ControlType.Document

Sep 9, 2010 at 4:09 PM

Hi,

I've an application that displays results on what it effectivly a large text box. However here is what the logstructure is displaying:

AutomationId: txtResults
    ControlType: ControlType.Document
    Name: Results
    HelpText:
    Bounding rectangle: 316,527,475,403
    ClassName: WindowsForms10.EDIT.app.0.378734a
    IsOffScreen: False
    FrameworkId: WinForm
    ProcessId: 1824

    System.Windows.Automation.ScrollPattern
    System.Windows.Automation.TextPattern

        AutomationId: Vertical ScrollBar
        ControlType: ControlType.ScrollBar
        Name: Results
        HelpText:
        Bounding rectangle: 772,529,17,399
        ClassName:
        IsOffScreen: False
        FrameworkId: WinForm
        ProcessId: 1824


            AutomationId: SmallDecrement
            ControlType: ControlType.Button
            Name: Back by small amount
            HelpText:
            Bounding rectangle: 772,529,17,17
            ClassName:
            IsOffScreen: False
            FrameworkId: WinForm
            ProcessId: 1824

            System.Windows.Automation.InvokePattern

            AutomationId: SmallIncrement
            ControlType: ControlType.Button
            Name: Forward by small amount
            HelpText:
            Bounding rectangle: 772,911,17,17
            ClassName:
            IsOffScreen: False
            FrameworkId: WinForm
            ProcessId: 1824

            System.Windows.Automation.InvokePattern

What's the easiest way for me to access the text in this ControlType.Document? I want to write the results into a text file.
I've tried the following but obviously this blows up.

string strResultsFromCreateFile = Form.Get<TextBox>("txtResults").Text;

Sep 10, 2010 at 2:27 PM

Never mind. Just use a MultilineTextBox instead of a normal TextBox.