2014-04-16 2 views
1

VS2010을 사용하여 Windows 7에서 WPF/C#/.NET 4.0 응용 프로그램을 개발했습니다. 응용 프로그램은 훌륭하게 작동하며 XP 및 Windows 7에서 정상적으로 실행됩니다. 그러나 최신 업데이트가있는 Windows 8에서는 기본적으로 선택된 단추 이외의 라디오 단추가 공간에 표시되지만 팝업에는 나타나지 않습니다. 라디오 버튼이 있어야하는 곳 위로 마우스를 이동하면 마우스가 위에있을 때와 같이 버튼이 나타납니다. 마우스가 그 위에 놓이면 마우스가 위에 있지 않을 때와 같이 시작해야하는 것처럼 보이지만 그렇지 않은 것처럼 단추가 나타납니다.팝업창에서 Windows 8에 라디오 버튼이 나타나지 않는 이유는 무엇입니까?

라디오 단추가있는 다른 모든 상황에서는 꼭해야하는 것처럼 정렬되지 않은 채로 작동합니다. 그들은 XP와 Windows 7에서 정확하게 정렬됩니다.

수정 : .NET 3.5를 사용하여 개발했으며 최근에는 .NET 4.0 플랫폼으로 변경되었습니다. .NET 3.5 플랫폼에서 컴파일하고 Windows 8에서 실행하면 해당 라디오 버튼이 나타나야합니다. .NET 4.0 플랫폼으로 전환하고 컴파일 한 다음 Windows 8에서 실행하는 것 외에는 아무 것도 변경하지 않고 라디오 버튼을 더 이상 나타나지 않지만 마우스를 이동해야하는 것처럼 나타납니다.

팝업이 처음 표시 될 때 마우스가 아닌 상태에서 해당 라디오 버튼을 표시하려면 어떻게합니까? 그것은 쉽게 수정으로 밝혀졌다

<Popup Name="MainPrintMenu" 
     PlacementTarget="{Binding ElementName=btnPrint}" 
     Placement="Bottom" 
     HorizontalOffset="-99" 
     VerticalOffset="-5" 
     AllowsTransparency="True" 
     StaysOpen="False"> 
    <Border BorderThickness="2" 
      Background="White" 
      CornerRadius="5" 
      BorderBrush="Black"> 
     <Grid Background="Transparent"> 
      <StackPanel Name="PrintButtons" 
         Orientation="Vertical" 
         Background="Transparent" 
         Margin="5" 
         > 
       <StackPanel.Resources> 
        <Style TargetType="Button"> 
         <Setter Property="FontSize" Value="12" /> 
         <Setter Property="FontWeight" Value="Bold" /> 
         <Setter Property="HorizontalContentAlignment" Value="Center" /> 
         <Setter Property="BorderBrush" Value="{x:Null}" /> 
        </Style> 
        <Style TargetType="RadioButton"> 
         <Setter Property="FontSize" Value="10" /> 
         <Setter Property="FontWeight" Value="Bold" /> 
         <Setter Property="HorizontalContentAlignment" Value="Left" /> 
         <Setter Property="BorderBrush" Value="{x:Null}" /> 
         <Style.Triggers> 
          <Trigger Property="IsEnabled" Value="False"> 
           <Setter Property="Opacity" Value="0.50" /> 
          </Trigger> 
         </Style.Triggers> 
        </Style> 
        <Style TargetType="CheckBox"> 
         <Setter Property="FontSize" Value="10" /> 
         <Setter Property="HorizontalContentAlignment" Value="Left" /> 
         <Setter Property="Margin" Value="18,0,0,10" /> 
         <Setter Property="BorderBrush" Value="{x:Null}" /> 
         <Style.Triggers> 
          <Trigger Property="IsEnabled" Value="False"> 
           <Setter Property="Opacity" Value="0.50" /> 
          </Trigger> 
         </Style.Triggers> 
        </Style> 
       </StackPanel.Resources> 

       <RadioButton Name="MainPrintMenu_PQAI" GroupName="PM" Content="Print My 911 Info" IsChecked="True" /> 
       <StackPanel Orientation="Vertical" IsEnabled="{Binding ElementName=MainPrintMenu_PQAI, Path=IsChecked}" Margin="18,0,0,0"> 
        <RadioButton Name="MainPrintMenu_PQAIR" GroupName="PM_PQAI" Content="Report" IsChecked="True" /> 
        <CheckBox Name="PQAI_Blank" Content="Print blank entries too" IsEnabled="{Binding ElementName=MainPrintMenu_PQAIR, Path=IsChecked}" Margin="18,0,0,0" /> 
        <RadioButton Name="MainPrintMenu_PQAIW" GroupName="PM_PQAI" Content="Wallet Card" Margin="0,0,0,10" /> 
       </StackPanel> 

       <StackPanel Name="PrintIfLoggedIn" Orientation="Vertical"> 
        <RadioButton Name="MainPrintMenu_PAF" GroupName="PM" Content="Print All Folders"/> 
        <CheckBox Name="PAF_Blank" Content="Print blank entries too" IsEnabled="{Binding ElementName=MainPrintMenu_PAF, Path=IsChecked}" /> 
        <RadioButton Name="MainPrintMenu_PCF" GroupName="PM" Content="Print Current Folder: Folder" /> 
        <CheckBox Name="PCF_Blank" Content="Print blank entries too" IsEnabled="{Binding ElementName=MainPrintMenu_PCF, Path=IsChecked}" /> 
        <RadioButton Name="MainPrintMenu_PCSF" GroupName="PM" Content="Print Current Sub-Folder: :[Sub-FolderName]:" /> 
        <CheckBox Name="PCSF_Blank" Content="Print blank entries too" IsEnabled="{Binding ElementName=MainPrintMenu_PCSF, Path=IsChecked}" /> 
        <RadioButton Name="MainPrintMenu_PCForm" GroupName="PM" Content="Print Current Form: :[From]:" /> 
        <CheckBox Name="PCForm_Blank" Content="Print blank entries too" IsEnabled="{Binding ElementName=MainPrintMenu_PCForm, Path=IsChecked}" /> 
        <RadioButton Name="MainPrintMenu_PQRC" GroupName="PM" Content="Print QR Code" /> 
        <StackPanel Margin="18,0,0,0" Orientation="Horizontal" > 
         <Image Source="/LR;Component/Image/LR_QR.jpg" Width="30" Height="30" Margin="0,2,5,0" VerticalAlignment="Top" /> 
         <TextBlock Width="250" Height="86" FontSize="8" TextWrapping="Wrap" IsEnabled="{Binding ElementName=MainPrintMenu_PQRC, Path=IsChecked}" > 
          A QR code is a small graphic image that can be quickly scanned by smartphone and 
          other devices.<LineBreak/><LineBreak/> 
          The QR code will contain only the emergency information you entered into the Quick 
          Assist folder.<LineBreak/><LineBreak/> 
          Print the QR code and affix it to the back of your LR USB card (or elsewhere). 
          In an emergency it can be scanned and your important information available immediately 
          (no need to start LR) 
         </TextBlock> 
        </StackPanel> 
       </StackPanel> 

       <StackPanel Orientation="Horizontal" Margin="0,5,0,0"> 
        <Button Content="Print" Width="233" Click="Event_MainPrintMenu_Print_Click" IsEnabled="{Binding BindingGroupName=MPM, Path=Selected}"/> 
        <Button Content="Cancel" Width="70" Click="Event_MainPrintMenu_Cancel_Click" /> 
       </StackPanel> 

      </StackPanel> 
     </Grid> 
    </Border> 
</Popup> 
+0

일부 XAML 형태로 예제를 제공 할 수 있습니까? – JMK

+0

초기 게시물을 편집 했으므로 이제 팝업의 XAML이 포함됩니다. 해당 XAML의 위치 : [] : 프로그래밍 방식으로 적절한 텍스트로 바뀝니다. 이 모든 것이 XP에서 Windows 8.X까지의 모든 OS에서 잘 작동한다는 점을 명심하십시오. 라디오 단추는 Windows 8.X에서 마우스 위로 가져올 때까지 제대로 표시되지 않습니다. 문제를 조사해 주셔서 감사합니다. – RFM

답변

0

: 여기

다른 모든 컨트롤 표시 및 체크 박스로 Windows 8에서 잘 작동, 팝업 XAML입니다. 다음은 변경된 위의 질문에서 XAML 부분입니다 :

<Style TargetType="RadioButton"> 
    <Setter Property="FontSize" Value="10" /> 
    <Setter Property="FontWeight" Value="Bold" /> 
    <Setter Property="HorizontalContentAlignment" Value="Left" /> 
    <Setter Property="BorderBrush" Value="{x:Null}" /> 
    <Style.Triggers> 
     <Trigger Property="IsEnabled" Value="False"> 
      <Setter Property="Opacity" Value="0.50" /> 
     </Trigger> 
    </Style.Triggers> 
</Style> 

모든 그 위의 XAML에서 다음 줄을 제거했다 필요했다 :

<Setter Property="BorderBrush" Value="{x:Null}" /> 

설명서의 RadioButton의 스타일을하는 XAML이왔다 여기에 다른 게시물에서,하지만 가치가 어디 내가 필요로 변경됩니다. 나는 BorderBrush 값을 그대로 두었습니다.

관련 문제