annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Example using CaptionSource_MacroExpression anywhere?

Risolto!
Vai alla soluzione

I'm using C# to develop a custom user interface and I'm trying to figure out how to pass a format expression (ie. "%ProgressTextLongName% %ProgressPercentLongName%") to the CaptionSources.CaptionSource_MacroExpression using

AxExecutionViewMgr's ConnectCaption() method and CaptionConnection's FormatExpression property. I'm using the following code to do so:

 

CaptionConnection cc = axExecutionViewMgr.ConnectCaption(axLabel2, CaptionSources.CaptionSource_MacroExpression, true);
cc.FormatExpression = "%ProgressTextLongName% %ProgressPercentLongName%";

 

But all the label says is "The expression cannot be empty". It says this even though I perform an execution of a sequence. Are there any examples that show how to use this macro expression anywhere?

0 Kudos
Messaggio 1 di 3
3.742Visualizzazioni
Soluzione
Accettato da autore argomento MSumulong

Just a guess, but since it is an expression, it probably needs quotes to make it a valid string expression:

 

cc.FormatExpression = "\"%ProgressTextLongName% %ProgressPercentLongName%\'";

0 Kudos
Messaggio 2 di 3
3.740Visualizzazioni

That worked! Thanks!

0 Kudos
Messaggio 3 di 3
3.715Visualizzazioni