Hallo,
meine Applikation meint immer
"Beim aufrufenden Thread muss es sich um einen STA-Thread handeln, da dies für viele Komponenten der Benutzeroberfläche erforderlich ist."
wenn ich ein Fenster anzeigen will.
Das Fenster ist nichts besonderes. Es hat eine HTMLBox und bekommt dynamisch noch zwi Buttons dazu.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
| <Window x:Class="IvisionStudioTE.Dialogs.HtmlWindowDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes" xmlns:wb="clr-namespace:IvisionStudioTE.UIControls" MinHeight="120" MinWidth="520" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" Title="" Topmost="False" SizeToContent="Manual" VerticalAlignment="Center" HorizontalAlignment="Center" WindowStyle="ToolWindow" KeyDown="Window_KeyDown" ResizeMode="NoResize" PreviewKeyDown="Window_PreviewKeyDown">
<Window.Resources> <Style TargetType="Button"> <Setter Property="Margin" Value="8,8,8,8"/> <Setter Property="Height" Value="28"/> <Setter Property="Width" Value="248"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </Window.Resources>
<Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto"/> </Grid.RowDefinitions>
<StackPanel Name="buttonPanel" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Height="50"/>
<wb:HtmlBox Grid.Row="0" x:Name="htmlBox" Margin="0"/>
<Grid.Background> <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"> <GradientStop Color="#FF99A6C4" Offset="0" /> <GradientStop Color="White" Offset="1" /> </LinearGradientBrush> </Grid.Background> </Grid> </Window> |
Der Aufruf des Fensters erfolg innerhalb einer TCP/IP-Kommunikation mit einem anderen Gerät.
Also TCP/IP-Verbindung wird aufgebaut, irgendwann schickt das andere Gerät einen Anforderung und dann soll das Fenster angezeigt werden.
Wie werde ich nun diese Exception los?
"Normale" Messageboxen werden übrigens ohne "Meckern" dargestellt.
Moderiert von Th69: Topic aus Sonstiges (.NET) verschoben am Mi 13.05.2015 um 15:27