none
How many characters can a Value property contain? RRS feed

All replies

  • In practical terms, it was possible to establish that the maximum number of characters is 4096.

    But I can not find official information about this.

    Wednesday, September 18, 2019 3:11 PM
  • Hi ,folkwulf

    This forum is for "Discuss Windows SDK Documentation, Samples and Tools." It is C++ focused.

    Since your issue about C# I'll move it to C# forum for more professional support.

    Best regards,

    Strive


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 19, 2019 2:37 AM
  • Hi folkwulf,

    Based on my search, I find ValuePattern.ValuePatternInformation.Value Property is a type of string.

    Therefore, maybe you want to know how many characters string can set.

    The following link describes it, you could have a look.

    how many character can set for string variable?

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Thursday, September 19, 2019 7:30 AM
    Moderator
  • Hi Jack,

    Thanks for your reply, but this cannot help me.

    I have a situation: automation element (WinForms, TextBox) contains text with 6000 characters, however ValuePattern.ValuePatternInformation.Value Property displays 4096 characters. As a result, on the automation side, I have a cropped string.

    I am trying to find an official description of the maximum length for a ValuePattern.ValuePatternInformation.Value Property, but have not found this yet.

    Best Regards,

    folkwulf.

    Thursday, September 19, 2019 10:03 AM
  • Hi folkwulf,

    Thanks for the feedback.

    I find the value property is readl-only. Then I think it is related that how do you get the value.Could you provide the related code about getting the value?

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 20, 2019 9:08 AM
    Moderator
  • Yes, below is a piece of code that is executed without error, but returns cropped value.

    var valuePattern = element.GetCurrentPattern(ValuePattern.Pattern) as ValuePattern; // element.Current.LocalizedControlType == 'edit'
    return valuePattern.Current.Value;

    Sincerely thank you for help.


    • Edited by folkwulf Wednesday, September 25, 2019 7:31 AM
    Wednesday, September 25, 2019 7:31 AM
  • Hi folkwulf,

    Thanks for the feedback.

    I am not familiar with how to use AutomationElement. Therefore, how do you get the element in your code?

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 26, 2019 8:31 AM
    Moderator
  • I get the element in my code as follows:

    using System.Windows.Automation;

    ...

    string windowId = "some_window_automation_id";
    AutomationElement myWindow = AutomationElement.RootElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.AutomationIdProperty, windowId));

    string elementId = "some_element_automation_id";
    AutomationElement element = myWindow.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.AutomationIdProperty, elementId));

    ...

    Sincerely thank you for help.


    • Edited by folkwulf Friday, October 4, 2019 11:28 AM
    Friday, October 4, 2019 7:17 AM