跳至主內容

搜尋

搜尋

How To Find And Change The Text Of Labels At Runtime

評論

2 條評論

  • Avatar
    Ian Cummings
    版主

    You need to specify a name for the data source in your BarTender document so that you may reference it to set/get from your external application.  See the BarTender Help system for a full reference on how to integrate with BarTender using the .NET component.

     

    Here is an example:

     

    'This is how you would GET a value of a named data source.
    Engine btEngine = new Engine(); 
    LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\MyLabel.btw");
    string AddressSubstring = btFormat.SubStrings["Address"].Value;
    
    'By contrast, this is how you would set values in a document's data source.
    Engine btEngine = new Engine(); 
    LabelFormatDocument btFormat = btEngine.Documents.Open(@"c:\MyLabel.btw");
    btFormat.SubStrings["Address"].Value = "1313 Mockingbird Lane, Anywhere, USA"; 
    btFormat.SubStrings["Name"].Value = "John Doe"; 
    btFormat.SubStrings["Quantity"].Value = "10"; 
    
    
    
    0
  • Avatar
    Legacy Poster

    works like a charm. Thanks.

    0

登入寫評論。