In Windows Forms, you can adjust the spring attribute of toolstripstatuslabel to set the label in statusstrip to stretch (occupying all other space ):
In WPF, set horizontalcontentalignment of statusbaritem to stretch, but this can only be set for the last project:
<Statusbar>
<Statusbaritem>
<Button> A </button>
</Statusbaritem>
<Statusbaritem>
<Button> B </button>
</Statusbaritem>
<Statusbaritem horizontalcontentalignment = "stretch">
<Button> C </button>
</Statusbaritem>
</Statusbar>
Result:
If you want a more complex layout, You can redefine itemspanel of itemscontrol, for example, the slightly complex statusbar below:
<Stackpanel>
<! -- Set the statusbaritem style. The default value of horizontalcontentalignment is left -->
<Stackpanel. Resources>
<Style targettype = "statusbaritem">
<Setter property = "borderbrush" value = "red"/>
<Setter property = "borderthickness" value = "1"/>
<Setter property = "margin" value = "1"/>
<Setter property = "horizontalcontentalignment" value = "stretch"/>
<Setter property = "verticalcontentalignment" value = "stretch"/>
</Style>
</Stackpanel. Resources>
<Statusbar>
<! -- Set itemspanel to dockpanel -->
<Statusbar. itemspanel>
<Itemspaneltemplate>
<Dockpanel/>
</Itemspaneltemplate>
</Statusbar. itemspanel>
<Statusbaritem dockpanel. Dock = "TOP">
<Button> A </button>
</Statusbaritem>
<Statusbaritem dockpanel. Dock = "right">
<Button> B </button>
</Statusbaritem>
<Statusbaritem>
<Button> C </button>
</Statusbaritem>
</Statusbar>
</Stackpanel>
Result: