简体   繁体   中英

ms silverlight blend sketchflow - default text in combobox

I'd like to get the default text in a combo box to show "Select Team...."

Like this in WPF

Setting default text for a combo box

But in sketchflow.

How can I do this?

Thanks

it is a sliverlight project. my xaml reads:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="SchoolsLoginScreens.Screen_2"
Width="640" Height="480">

<Grid x:Name="LayoutRoot" Background="White">
<ComboBox Height="61.256" Width="136.569" IsEditable="True" IsReadOnly="True" Text="-- Select Team --"/>
</Grid>

It says that IsEditable does not have a setter. But this appears to work in WPF project like the examples above.

SketchFlow项目是WPF或SL项目(取决于您在创建项目时所选择的内容),因此对于WPF / SL找到的所有答案都应适用。

I had the same question and found this to help me. Essentially, you just have to add at least one item to the combo box (right-click, add ComboBoxItem) then look at the Common properties while the control is selected and you will see a field called "SelectIndex" that is currently set to -1. Just change this to 0 to select the first item in your list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM