-4

I am new to wpf and i need to embed the winforms status bar strips and progress bar into wpf. Is it possible to do that?

M.Mathan
  • 19
  • 4
  • They are different frameworks, different technologies built on different architecture and use different code patterns to achieve different results. Learn these differences and code your application accordingly – TheGeneral Nov 24 '18 at 07:01
  • Yeah but i need the data of winforms strips and also need to show through in wpf. For this issue, are any possible converters available? – M.Mathan Nov 24 '18 at 09:37
  • You can host windows forms controls in the wpf [WindowsFormsHost](https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf-by-using-xaml) container. – Handbag Crab Nov 24 '18 at 12:43

1 Answers1

2

You are going to have to figure out how to do it the WPF way, there are no conversions, just like there is no conversion with any other control.

Here is an example of using the status bar in WPF

The WPF StatusBar control

    <StatusBar DockPanel.Dock="Bottom">
        <StatusBar.ItemsPanel>
            <ItemsPanelTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="100" />
                    </Grid.ColumnDefinitions>
                </Grid>
            </ItemsPanelTemplate>
        </StatusBar.ItemsPanel>
        <StatusBarItem>
            <TextBlock Name="lblCursorPosition" />
        </StatusBarItem>
        <Separator Grid.Column="1" />
        <StatusBarItem Grid.Column="2">
            <TextBlock Text="c:\path\of\current\file.txt" />
        </StatusBarItem>
        <Separator Grid.Column="3" />
        <StatusBarItem Grid.Column="4">
            <ProgressBar Value="50" Width="90" Height="16" />
        </StatusBarItem>
    </StatusBar>

enter image description here

TheGeneral
  • 79,002
  • 9
  • 103
  • 141