Click here to Skip to main content
15,879,348 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: load usercontrol in background worker Pin
Mycroft Holmes11-Sep-20 12:20
professionalMycroft Holmes11-Sep-20 12:20 
GeneralRe: load usercontrol in background worker Pin
Rusdy Perkasa11-Sep-20 17:27
Rusdy Perkasa11-Sep-20 17:27 
GeneralRe: load usercontrol in background worker Pin
Gerry Schmitz11-Sep-20 18:14
mveGerry Schmitz11-Sep-20 18:14 
GeneralRe: load usercontrol in background worker Pin
Rusdy Perkasa11-Sep-20 18:28
Rusdy Perkasa11-Sep-20 18:28 
GeneralRe: load usercontrol in background worker Pin
Gerry Schmitz12-Sep-20 4:47
mveGerry Schmitz12-Sep-20 4:47 
GeneralRe: load usercontrol in background worker Pin
Eddy Vluggen12-Sep-20 8:44
professionalEddy Vluggen12-Sep-20 8:44 
QuestionCan we add animation to WPF just like we have SHAPE animation in powerpoint? Pin
User-86216959-Jul-20 23:57
User-86216959-Jul-20 23:57 
QuestionVertical text in WPF grid Pin
kalberts6-Jul-20 8:54
kalberts6-Jul-20 8:54 
I am making a table, using a grid, with one large left column, and to the right, four (or possibly more) check boxes / radio buttons, each in a quite narrow grid column. There is not enough room to label each of the CBs/RBs on every line, so I put the label in the top row, rotated 270 degrees as a vertical text, in a tall (100 units) but narrow (27 units) cell, just enough to hold the longest label.

My problem is that WPF appearently clips the label to the edges of the grid cell before rotating the contents, so in my first attempt, the label was clipped at 27 units while it was horizontal, and then this less-that-a-third of the label was rotated to vertical position. I discovered that I could use Grid.ColumnSpan="4" to give the labels enough horizontal space to be drawn in full before rotating. That works only if three extra columns exist, and that holds true only for the first radio button. So I have to place all four of them in column 1 (spanning cols 1-4), and then translate them horizontally to appear visually over their intended columns.

This is ugly, messy, inflexible and most certainly not something I would like to maintain in the future, with columns added, widths/heights adjusted, labels changed...:
XML
<Grid>
  <Grid.RowDefinitions>
    <RowDefinition Height="120" />
    <RowDefinition Height="27" />
    <RowDefinition Height="27"/>
    <RowDefinition Height="27"/>
  </Grid.RowDefinitions>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="27"/>
    <ColumnDefinition Width="27"/>
    <ColumnDefinition Width="27"/>
    <ColumnDefinition Width="27"/>
  </Grid.ColumnDefinitions>

  <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" Content="Slett permanent" Height="120" Width="120" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" >
    <Label.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="270"/>
      </TransformGroup>
    </Label.RenderTransform>
  </Label>

  <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" Content="Hopp over" Height="120" Width="120" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" >
   <Label.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="270"/>
        <TranslateTransform X="27"/>
      </TransformGroup>
    </Label.RenderTransform>
  </Label>

 <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" Content="Legg inn i SiKo" Height="120" Width="120" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center">
   <Label.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="270"/>
        <TranslateTransform X="54"/>
      </TransformGroup>
    </Label.RenderTransform>
  </Label>

  <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" Content="Kopier til kildedisk" Height="120" Width="120" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center">
    <Label.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="270"/>
        <TranslateTransform X="81"/>
      </TransformGroup>
    </Label.RenderTransform>
  </Label>
Then follows code to fill the rows of the table below this top row.


There must be a simpler and better way to write a vertical (270 degrees rotated) text label over a column! But how?

(As you may see, I am certainly not a guru in XAML programming, so please be kiond to me Smile | :) )
AnswerRe: Vertical text in WPF grid Pin
Gerry Schmitz6-Jul-20 12:10
mveGerry Schmitz6-Jul-20 12:10 
AnswerRe: Vertical text in WPF grid Pin
Richard Deeming6-Jul-20 23:43
mveRichard Deeming6-Jul-20 23:43 
GeneralRe: Vertical text in WPF grid Pin
kalberts7-Jul-20 5:03
kalberts7-Jul-20 5:03 
QuestionBehavior/DP Question Pin
Kevin Marois22-Jun-20 8:27
professionalKevin Marois22-Jun-20 8:27 
AnswerRe: Behavior/DP Question Pin
Richard Deeming23-Jun-20 4:44
mveRichard Deeming23-Jun-20 4:44 
GeneralRe: Behavior/DP Question Pin
Kevin Marois1-Jul-20 8:30
professionalKevin Marois1-Jul-20 8:30 
GeneralRe: Behavior/DP Question Pin
Richard Deeming1-Jul-20 23:32
mveRichard Deeming1-Jul-20 23:32 
GeneralRe: Behavior/DP Question Pin
Kevin Marois2-Jul-20 8:49
professionalKevin Marois2-Jul-20 8:49 
Question2 xaml windows question Pin
Michele Smith26-May-20 7:10
Michele Smith26-May-20 7:10 
AnswerRe: 2 xaml windows question Pin
#realJSOP26-May-20 7:43
mve#realJSOP26-May-20 7:43 
QuestionCreate DataGrid From List<T> With Properties As Columns Pin
Kevin Marois18-May-20 7:14
professionalKevin Marois18-May-20 7:14 
AnswerRe: Create DataGrid From List<T> With Properties As Columns Pin
Richard Deeming18-May-20 8:47
mveRichard Deeming18-May-20 8:47 
GeneralRe: Create DataGrid From List<T> With Properties As Columns Pin
Kevin Marois18-May-20 8:52
professionalKevin Marois18-May-20 8:52 
QuestionWPF ListBox Pin
michaelbarb7-May-20 10:03
michaelbarb7-May-20 10:03 
AnswerRe: WPF ListBox Pin
Richard Deeming10-May-20 21:52
mveRichard Deeming10-May-20 21:52 
GeneralRe: WPF ListBox Pin
michaelbarb11-May-20 19:11
michaelbarb11-May-20 19:11 
GeneralRe: WPF ListBox Pin
Mycroft Holmes11-May-20 21:33
professionalMycroft Holmes11-May-20 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.