fit-to-largest の値を false から true に変更したいこの XML ファイルがあります。このような:
<Hmi.Screen.TextField Name="Text Field_1" AggregationName="ScreenItems" ID="31">
<ObjectList>
<Hmi.Screen.Property Name="Layer" AggregationName="Properties" ID="77">
<AttributeList>
<Value>0</Value>
</AttributeList>
</Hmi.Screen.Property>
<Hmi.Screen.Property Name="Left" AggregationName="Properties" ID="78">
<AttributeList>
<Value>264</Value>
</AttributeList>
</Hmi.Screen.Property>
<Hmi.Screen.Property Name="Top" AggregationName="Properties" ID="79">
<AttributeList>
<Value>48</Value>
</AttributeList>
</Hmi.Screen.Property>
<Hmi.Screen.Property Name="FitToLargest" AggregationName="Properties" ID="84">
<AttributeList>
<Value>false</Value>
</AttributeList>
</Hmi.Screen.Property>
</ObjectList>
</Hmi.Screen.TextField>
このコードから、この部分を次のように変更します。
<Hmi.Screen.Property Name="FitToLargest" AggregationName="Properties" ID="84">
<AttributeList>
<Value>false</Value>
</AttributeList>
</Hmi.Screen.Property>
これに:
<Hmi.Screen.Property Name="FitToLargest" AggregationName="Properties" ID="84">
<AttributeList>
<Value>true</Value>
</AttributeList>
</Hmi.Screen.Property>
(偽が真になる)
XMLファイルをロードしてこれを変更し(方法は知っています)、falseを見つけてtrueに置き換えます。
コードのこの部分はすべてのテキスト フィールドにありますが、属性 ID の値が異なります。テキストフィールドごとに変更したい。