使用3.5,我只想在文本元素中添加换行符:
<Dialog><Control><Text>
The [Wizard] will install [ProductName]
on your computer.
Click Next to continue or Cancel to exit the [Wizard].
</Text></Control>....
似乎没有插入换行符。我怎样才能在那里获得一个换行符?
感谢。
答案 0 :(得分:7)
不幸的是,Windows Installer不支持静态文本控件中的换行符。在安装过程中,文本会根据控件和字体大小自动格式化。
但是,如果你真的想要换行,只需在下一行使用另一个静态文本控件。
答案 1 :(得分:3)
根据Adam的回答,您还可以将文本格式化为WixLocalization条目。 例如:
<WixLocalization xmlns="http://schemas.microsoft.com/wix/2006/localization" Culture="en-US">
<String Id="WelcomeDlgDescription">
This is a custom welcome message.
Click Next to continue or
Cancel to exit.</String>
</WixLocalization>
并在你的控制中使用它:
<Control Id="Description" Type="Text" X="50" Y="20" Width="200" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)"/>
答案 2 :(得分:2)
Text控件中关于换行符的official answer from Microsoft内容如下:
使用指定换行符显示文本的推荐方法是使用位于彼此下方的多个单行文本控件。控件的文本字段中的字符序列\ n,\ r \ n或\ n \ r \ n不会显示为换行符。这些字符序列由控件按字面显示。
答案 3 :(得分:2)
在this问题中偶然使用CDATA:
<Control><Text>
<![CDATA[
This is my text.
With a return line
]]>
</Text></Control>