跳至主內容

搜尋

搜尋

Prompt Vs Substrings

評論

5 條評論

  • Avatar
    Shotaro Ito

    Do you want to get all named data source (substring) names in a document?

    In that case, the code would be this.

    //list all named data sources
    //C# : btApp is Seagull.BarTender.Print.Engine
    
    btFmt = btApp.Documents.Open(@"c:\Test.btw");
    btFmt.PrintSetup.EnablePrompting = false;
    string buf = "";
    foreach (Seagull.BarTender.Print.SubString subs in btFmt.SubStrings)
    {
      buf += subs.Name + "\r\n";
    }
    MessageBox.Show(buf);
    0
  • Avatar
    Legacy Poster

    Do you want to get all named data source (substring) names in a document?

    In that case, the code would be this.

    //list all named data sources
    //C# : btApp is Seagull.BarTender.Print.Engine
    
    btFmt = btApp.Documents.Open(@"c:\Test.btw");
    btFmt.PrintSetup.EnablePrompting = false;
    string buf = "";
    foreach (Seagull.BarTender.Print.SubString subs in btFmt.SubStrings)
    {
      buf += subs.Name + "\r\n";
    }
    MessageBox.Show(buf);

     No I am only interested in the prompts. I do not want to expose all the substrings to the user. We have hundreds of predefined formats, when one is opened I need to show the same prompts as you would see opening the format in Bartender. The input boxes show Object Names ( EDIT CONTROL 1, 2, 3 etc.), while the text box that describes the input boxes do not show up as the prompt name.

     

    The substrings however, does show the textbox values associated with an input box and not just the object name.

    0
  • Avatar
    Shotaro Ito

    Yeah... I felt the question wasn't such a simple thing.

    There was a deprecated property LabelFormat.Prompts.LayoutXML which returns layout of prompt, however using this would not ensure the project to work with future version of BarTender newer than 10.1.

     

    You can either set value via named data sources (substrings) by name, or data entry control(prompt)'s object name.

    As you described, Prompt object in SDK doesn't have property of linked datasource name.

    sounds like you need to set meaningful object name to each data entry control at design time.

    Selected object name is shown in status bar (at the bottom of Data Entry Form design view).

    0
  • Avatar
    Legacy Poster

    Thanks you Shotaro,

     

    To be clear...you are suggesting that I first get the substrings (name) then set that to the prompt object name?

     

    I think I'll have the group that setup the labels change the object names to match the substrings.

     

    -LB

    0
  • Avatar
    Shotaro Ito

    Hi LB, You're right - that would be tiresome part, but once that's done, Prompt object's name would be meaningful.

    0

登入寫評論。