本文介绍了如何避免Wpf中的页面调整大小属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 <第x页:class =Opalus.Accounts.JournalEntryxmlns:x =#unknown> xmlns =http://schemas.microsoft.com/winfx/ 2006 / xaml / presentation xmlns:x =http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc =http: //schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d =http://schemas.microsoft.com/expression/blend/2008 mc:Ignorable =dTitle =Journal Entry xmlns:basic =clr-namespace:Opalus.Basic.Controls; assembly = Opalus.Basic.Controls PreviewKeyDown =UserControl_PreviewKeyDown xmlns:N =clr-namespace:Opalus.Accountsremoved =#FFF0F0F0 xmlns:opale =clr- namespace:Opale; assembly = Opale > < viewbox> < grid height =500> < grid.columndefinitions> < columndefinition width =Auto> < columndefinition width =*> < grid.rowdefinitions> < rowdefinition height =Auto> < rowdefinition height =*> < stackpanel grid.column =0name =spResponsegrid.columnspan =2margin =0,0,150,0removed =透明> < stackpanel grid.column =0grid.columnspan =2removed =Transparent > < border grid.column =1cornerradius =5verticalalignment =Topborderthickness =0removed =Transparent> < Label HorizontalContentAlignment =RightVerticalContentAlignment =TopContent =Journal EntryForeground =#FF1E40A7FontWeight =BoldFontSize =18VerticalAlignment =Top>< / Label> < grid grid.row =1grid.columnspan =2> <网格。 columndefinitions> < columndefinition width =Auto> < columndefinition width =*> < border cornerradius =8borderthickness =1height =Automargin =3> < border.background> < lineargradientbrush> < gradientstop color =#FFFDFDFDoffset =0> < gradientstop color =#FFDADADAoffset =1> < grid margin =3> < grid.rowdefinitions> < rowdefinition height =Auto> < rowdefinition height =*> < rowdefinition height =Auto> < listview itemssource ={Binding}x:name =lstJournalEntryheight =375grid.row =1selectionchanged =lstJournalEntry_SelectionChanged>保证金=3> < listview.view> < gridview> < gridviewcolumn displaymemberbinding ={Binding Path = id_voucher}width =0> < gridviewcolumn displaymemberbinding ={Binding Path =冻结}width =0> < gridviewcolumn width =80displaymemberbinding ={Binding Path = voucher_number}> < gridviewcolumn。标题> < gridviewcolumnheader content =VNohorizontalcontentalignment =Leftfontweight =DemiBoldclick =GridViewColumnHeader_Clicktag =voucher_number> < gridviewcolumn width =165displaymemberbinding ={Binding Path = date,StringFormat ='{} {0:dd / MM / yyyy}'}> < gridviewcolumn.header> < gridviewcolumnheader content =VDatehorizontalcontentalignment =Leftfontweight =DemiBoldclick =GridViewColumnHeader_Clicktag =date> < listview.itemcontainerstyle> < Style TargetType =ListViewItem> < Style.Triggers> < datatrigger binding ={Binding Path = canceled}value =True > < setter property =Backgroundvalue =#f7f7f7> < /Style.Triggers> < / Style> < listview.contextmenu> < contextmenu> < menuitem header =编辑name =mniEditclick =mniEdit_Click> < menuitem header =取消click = MenuItem_Click> < menuitem header =冻结name =MniFreezeclick =MniFreeze_Click> < menuitem header =删除点击=MenuItem_Click_1> < menuitem header =Recurrimgname =mniRecurringclick =btnReccur_Click> < menuitem header =全部显示name =mniShowclick =mniShow_Click> < stackpanel grid.row =0grid.column =0> < grid> < grid.rowdef initions> < rowdefinition height =Auto> < stackpanel orientation =Horizontalwidth =Auto> < toolbartray removed =Transparent> < toolbar> < menuitem x:name =miNewclick =miNew_Clickwidth =25tooltip =New> < menuitem.icon> < Image Source =/ Opalus.Accounts; component / Images / Add.pngWidth =25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}} > < menuitem x:name =miSaveclick =miSave_Clickwidth =25tooltip =Save> < menuitem.icon> ; < Image Source =/ Opalus.Accounts; component / Images / Save.pngWidth =25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}}> < menuitem x:name =miEditclick = miEdit_Clickwidth =25tooltip =Edit> < menuitem.icon> < Image Source =/ Opalus.Accounts; component / Images / Edit.png宽度=25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}}> < menuitem x:name =miDeleteclick =miDelete_Clickwidth =25tooltip =删除> < menuitem.icon> < Image Source =/ Opalus.Accounts; component / Images / Delete。 png宽度=25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey} }> < menuitem x:name =miPrintPreviewwidth =25tooltip =Print Previewclick =miPrintPreview_Click> < menuitem.icon> < Image Source =/ Opalus.A ccounts; component / Images / Preview.pngWidth =25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}}> < menuitem x:name =miPrinttooltip =Printwidth =25click =miPrint_Click> < menuitem.icon> < Image Source =/ Opalus.Accounts; component / Images / Print.pngWidth =25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}}> < menuitem x:name =miWritXMLtooltip =Write XMLwidth =25click =miWritXML_Click> < menuitem.icon> < Image Source =/ Opalus.Accounts; component / Images / Write.pngWidth =25/> < separator style ={StaticResource {x:Static ToolBar.SeparatorStyleKey}}> < menuitem x:name = miHelptooltip =Helpwidth =25click =miHelp_Click> < menuitem.icon> < Image Source =/ Opalus .Accounts; component / Images / Help.png宽度=25/> < textbox borderthickness =。5padding =5foreground =Grayx:name =Invoice_list_search_txtmargin =3,0,3,0> HorizontalContentAlignment =中心BorderBrush =#FF938686TextChanged =Invoice_list_search_txt_TextChangedGrid.Row =2 GotFocus =Invoice_list_search_txt_GotFocusLostFocus =Invoice_list_search_txt_LostFocusTabIndex =41> < border cornerradius =8width =Autogrid.column =2borderthickness = 1height =Auto> < border.background> < lineargradientbrush> < gradientstop color =#FFFDFDFDoffset =0> < gradientstop color =#FFDADADAoffset =1> < grid width =Automargin =3> < grid.resources> < Style TargetType =Label > < setter property =Heightvalue =24> < / Style> < grid.rowdefinitions> < rowdefinition height =Auto> < rowdefinition height =Auto> < rowdefinition height =Auto> < rowdefinition> < rowdefinition height =Auto> < grid.columndefinitions> < columndefinition width =Auto > < columndefinition width =100> < columndefinition width =Auto> < columndefinition width =Auto> < columndefinition width =Auto> < columndefinition width =Auto> < columndefinition width =10> < columndefinition width =Auto> < columndefinition width =Auto> < Label Content =凭证编号:HorizontalAlignment =LeftGrid.Row =0Grid.Column =0TabIndex =0Width =75/> < textbox x:name =TextVoucherNogrid.row =0grid.column =1width =115horizontalalignment =Left height =24maxlines =2tabindex =2> < ellipse grid.column =1width =23stroke =#FF8D7373> < ellipse.fill> < lineargradientbrush endpoint =0.5,1startpoint =0.5,0> < gradientstop color =#FFC1B5B5offset =1> < gradientstop color =Whiteoffset =0> < Label Content =! Width =18Grid.Row =0Grid.Column =1TabIndex =3Margin =4,0,0,0> < Label.ToolTip> ; < tooltip content =Informationstyle ={StaticResource ResourceKey = CustomStyle}> < /Label.ToolTip> < / Label> < Label Content =Date:Grid.Column =3Grid.Row =0TabIndex =4 /> < datepicker width =105height =25x:name =dpJournalDategrid.column =4selecteddatechanged =dpJournalDate_SelectedDateChangedisenabled =Falsetabindex =5> <标签内容=RF ID:Grid.Row =0Grid.Column =5Height =25TabIndex =6/> ; < textbox grid.row =0grid.column =6x:name =TextReferenceIdheight =25keydown =TextReferenceId_KeyDown textc hanged =TextReferenceId_TextChangedtabindex =8> < Label Content =Currency:Grid.Column =7Height =24/> < n:currencycontrol x:name =ComboCurrency1height =25width =50grid.column =9grid.row =0keydown =ComboCurrency1_KeyDown tabindex =9focusable =Truexmlns:n =#unknown> < Label Content =Project:Grid.Row = 1高度=24TabIndex =12VerticalAlignment =Bottom/> < opale:opaletextbox name =TextProjectsgrid.column =1grid.row =1height =24textformat =Popuppopupdone =TextProjects_PopupDonetabindex =14xmlns:opale =#unknown> < ; Label Content =Name =lblAutoGrid.Row =1Grid.Column =6Height =24TabIndex =15Width =100HorizontalAlignment =Left/> < Label Content =Au到Id:Grid.Row =1Grid.Column =5TabIndex =16/> < Label Content =备注: Grid.Row =2Grid.Column =0TabIndex =17/> < textbox x:name =TextRemarksheight =25horizontalalignment =Leftgrid.column =1width =335acceptedreturn =True> TextWrapping =WrapVerticalScrollBarVisibility =VisibleGrid.Row = 2TabIndex =19/> < border borderthickness =1cornerradius =6grid.row =3borderbrush = #9a9a9agrid.columnspan =9grid.rowspan =2> < grid height =Auto> < grid.rowdefinitions> ; < rowdefinition height =Auto> < rowdefinition height =Auto> < rowdefinition height =Auto> < rowdefinition height =300> < rowdefinition height =Auto> < grid.columndefinitions> < columndefinition width =150> < columndefinition width =250> < columndefinition width =350> < columndefinition width =100> < columndefinition width =100> < columndefinition> <标签内容=帐户代码Grid.Row =1TabIndex =20Grid.Column =0/> < opale:opaletextbox name =TextAccountCodetextformat =Popupgrid.row =2grid.column =0popupdone =TextAccountCode_PopupDonepreviewkeydown =TextAccountCode_PreviewKeyDowntabindex =21showcalendar =Falsexmlns:opale =#unknown> < Label Content =Account NameGrid.Row =1Grid.Column = 1TabIndex =22/> < textbox name =TextAccountNamegrid.row =2grid.column =1isreadonly =Truetabindex =23 > < Label Content =DescriptionGrid.Row =1Grid.Column =2TabIndex =24/> < textbox name =TextDescriptiongrid.row =2grid.column =2tabindex =25lostfocus =TextDescription_LostFocus> < Label Content =DebitGrid.Row =1Grid.Column =3TabIndex =26/> < opale:opaletextbox name =TextDebitgrid.row =2grid.column =3xmlns:opale =#unknown> LostFocus =TextDebit_LostFocus TextChanged =TextDebit_TextChanged TextFormat =NumericTabIndex =27IsTabStop =TrueTextAlignment =Right/> < Label Content =CreditGrid.Row =1Grid.Column =4TabIndex =28/> < opale:opaletextbox name =TextCredit grid.row =2grid.column =4lostfocus =TextCredit_LostFocus> TextChanged =TextCredit_TextChangedTabIndex =29IsTabStop =True/> < Button Name =btnAddGrid.Row =1Grid.Column =4Height =28Width =25HorizontalAlignment =CenterMargin =20,0,0,0 Click =btnAdd_ClickToolTip =AddTabIndex =30HorizontalContentAlignment =CenterVerticalContentAlignment =Center> < Image Source =/ Opalus。帐户;组件/图像/ RecAdd.pngStretch =UniformToFill/> < / Button> < Button Name =btnResetGrid.Row =1Grid.Column =4Height =28Width =25HorizontalAlignment =Right Click =btnReset_ClickToolTip =ResetTabIndex =30HorizontalContentAlignment =中心VerticalContentAlignment =中心> < Image Source =/ Opalus.Accounts; component / Images / Refresh.pngStretch =UniformToFill/> < / Button> < datagrid autogeneratecolumns =Falseverticalscrollbarvisibility =Autohorizontalscrollbarvisibility =Hiddenname =dgvTransrowheaderwidth =0> ItemsSource ={Binding}CanUserAddRows =FalseTabIndex =32CanUserSortColumns =FalseCanUserReorderColumns =FalseCanUserDeleteRows =True GridLinesVisibility =VerticalGrid.Row = 3HorizontalAlignment =Left AlternatingRowBackground =#edf3fdRowremoved =#FFFFFFVerticalGridLinesBrush =WhiteColumnWidth =150IsReadOnly =TrueWidth =AutoGrid。 Column =0Grid.ColumnSpan =9> < datagrid.resources> < Style TargetType = {x:输入DataGridRow}> < setter prope rty =Heightvalue =20> < / Style> < Style TargetType ={x:Type DataGridColumnHeader}> < setter property =FontWeightvalue =DemiBold> < / Style> < datagrid.columns> < datagridtextcolumn header =帐户代码width =150binding ={Binding account_code}> < datagridtextcolumn header =帐户名称width =250binding ={Binding account_name}> < datagridtextcolumn header =描述width =350绑定={Binding description}> < dat agridtextcolumn header =Debitwidth =100binding ={Binding debit,StringFormat = N2}> < datagridtextcolumn.elementstyle> < Style TargetType =TextBlock> < setter property =TextAlignmentvalue =Right> < / Style> < datagridtextcolumn header =Creditwidth =100binding ={Binding credit,StringFormat = N2}> < datagridtextcolumn.elementstyle> < Style TargetType =TextBlock> < setter prope rty =TextAlignmentvalue =Right> < / Style> < datagridtextcolumn header =IDbinding ={Binding id_account_trans}visibility =Collapsed> < datagridtextcolumn header =IDAccountbinding ={绑定id_accounts}visibility =Collapsed> < datagridtextcolumn header =IDVocherbinding ={Binding id_voucher}visibility =Collapsed> < datagridtextcolumn header =IDAccountTransDatebinding ={Binding date}visibility =Collapsed> < datagridtextcolumn header =OpeningBalancebinding ={Binding opening_balance}visibility =折叠> < datagridtextcolumn header =ClosingBalancebinding ={Binding closing_balance}visibility =Collapsed> < datagridtextcolumn header =BaseDebitbinding ={ Binding base_debit}visibility =Collapsed> < datagridtextcolumn header =BaseCreditbinding ={Binding base_cerdit}visibility =Collapsed> < datagridtextcolumn header =Currencybinding ={Binding currency}visibility =Collapsed> < datagridtextcolumn header =RefIdbinding ={Binding ref_id}visibility =折叠> < datagridtextcolumn header =TransReferenceNobinding ={Binding transfer_reference_number}visibility =Collapsed> < datagridtextcolum n header =RowTypebinding ={Binding row_type}visibility =Collapsed> < datagridtextcolumn header =paymentModebinding ={Binding payment_mode}visibility =Collapsed > < datagrid.contextmenu> < contextmenu> < menuitem name = TransEditheader =编辑click =TransEdit_Click> < menuitem name =TransDeleteheader =删除click =TransDelete_Click> < stackpanel grid.row =4grid.column =3grid.columnspan =2orientation = 水平> < textbox> Width =100IsReadOnly =TrueName =TextTotalDebitTabIndex =33 FontFamily =TahomaFontSize =13 FontWeight =DemiBoldHorizontalContentAlignment =Right /> < textbox grid.row =4horizontalalignment =Rightgrid.column =4 width =100> IsReadOnly =TrueName =TextTotalCreditTabIndex =34 FontFamily =TahomaFontSize =13FontWeight =DemiBoldHorizontalContentAlignment =正确/> < popup name = PopupReccurantplacement =MousePointallowstransparency =Truegrid.column =0grid.row =0grid.columnspan =2> & lt; groupbox removed =#eef9feheader =Reccuring detailsmargin =5borderthickness =2borderbrush =#bdd4dfwidth =Auto> < grid height =自动删除=#eef9femargin =5> < grid.columndefinitions> < columndefinition width =Auto> < columndefinition width =Auto> < columndefinition width =*> < grid.rowdefinitions> < rowdefinition height =Auto> < rowdefinition height =Auto> < rowdefinition height =*> < grid.resources> < Style TargetType =Label> < setter property =Widthvalue =63> < / Style> < Style TargetType =TextBox> < setter property =Heightvalue =25> < / Style> < Style TargetType =Button> < setter property =Widthvalue =55> < setter property =Heightvalue =25> < / Style> < Label Content =DurationGrid.Row =0 Grid.Column =0HorizontalAlignment =Left/> < textbox name =TextDurationwidth =150grid.row =0grid.column =1 > < Label Content =FrequencyGrid.Row =1Grid.Column =0HorizontalAlignment =Left/> < textbox name =TextFrequencywidth =150grid.row =1grid.column =1> < Button Name =btnReccurringContent =ApplyWidth = 120Grid.Row =2Grid.Colu mn =0Grid.RowSpan =2HorizontalAlignment =CenterClick =btnReccurring_Click/> < Button Name =btnRecCancelContent =CancelWidth =120 Grid.Row =2Grid.Column =1Grid.RowSpan =2HorizontalAlignment =CenterClick =btnRecCancel_Click/> Please Check the Given Code. How Can i Avoid The Page Resizing Property<page x:class="Opalus.Accounts.JournalEntry" xmlns:x="#unknown"> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Title="Journal Entry" xmlns:basic="clr-namespace:Opalus.Basic.Controls;assembly=Opalus.Basic.Controls" PreviewKeyDown="UserControl_PreviewKeyDown" xmlns:N="clr-namespace:Opalus.Accounts" removed="#FFF0F0F0" xmlns:opale="clr-namespace:Opale;assembly=Opale" > <viewbox> <grid height="500"> <grid.columndefinitions> <columndefinition width="Auto"> <columndefinition width="*"> <grid.rowdefinitions> <rowdefinition height="Auto"> <rowdefinition height="*"> <stackpanel grid.column="0" name="spResponse" grid.columnspan="2" margin="0,0,150,0" removed="Transparent"> <stackpanel grid.column="0" grid.columnspan="2" removed="Transparent"> <border grid.column="1" cornerradius="5" verticalalignment="Top" borderthickness="0" removed="Transparent"> <Label HorizontalContentAlignment="Right" VerticalContentAlignment="Top" Content="Journal Entry" Foreground="#FF1E40A7" FontWeight="Bold" FontSize="18" VerticalAlignment="Top"></Label> <grid grid.row="1" grid.columnspan="2"> <grid.columndefinitions> <columndefinition width="Auto"> <columndefinition width="*"> <border cornerradius="8" borderthickness="1" height="Auto" margin="3"> <border.background> <lineargradientbrush> <gradientstop color="#FFFDFDFD" offset="0"> <gradientstop color="#FFDADADA" offset="1"> <grid margin="3"> <grid.rowdefinitions> <rowdefinition height="Auto"> <rowdefinition height="*"> <rowdefinition height="Auto"> <listview itemssource="{Binding}" x:name="lstJournalEntry" height="375" grid.row="1" selectionchanged="lstJournalEntry_SelectionChanged"> Margin="3"> <listview.view> <gridview> <gridviewcolumn displaymemberbinding="{Binding Path=id_voucher}" width="0"> <gridviewcolumn displaymemberbinding="{Binding Path=freeze}" width="0"> <gridviewcolumn width="80" displaymemberbinding="{Binding Path=voucher_number}"> <gridviewcolumn.header> <gridviewcolumnheader content="VNo" horizontalcontentalignment="Left" fontweight="DemiBold" click="GridViewColumnHeader_Click" tag="voucher_number"> <gridviewcolumn width="165" displaymemberbinding="{Binding Path=date,StringFormat='{}{0:dd/MM/yyyy}'}"> <gridviewcolumn.header> <gridviewcolumnheader content="VDate" horizontalcontentalignment="Left" fontweight="DemiBold" click="GridViewColumnHeader_Click" tag="date"> <listview.itemcontainerstyle> <Style TargetType="ListViewItem"> <Style.Triggers> <datatrigger binding="{Binding Path=cancelled}" value="True"> <setter property="Background" value="#f7f7f7"> </Style.Triggers> </Style> <listview.contextmenu> <contextmenu> <menuitem header="Edit" name="mniEdit" click="mniEdit_Click"> <menuitem header="Cancel" click="MenuItem_Click"> <menuitem header="Freeze" name="MniFreeze" click="MniFreeze_Click"> <menuitem header="Delete" click="MenuItem_Click_1"> <menuitem header=" Recurrimg" name="mniRecurring" click="btnReccur_Click"> <menuitem header="Show All" name="mniShow" click="mniShow_Click"> <stackpanel grid.row="0" grid.column="0"> <grid> <grid.rowdefinitions> <rowdefinition height="Auto"> <stackpanel orientation="Horizontal" width="Auto"> <toolbartray removed="Transparent"> <toolbar> <menuitem x:name="miNew" click="miNew_Click" width="25" tooltip="New"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Add.png" Width="25" /> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miSave" click="miSave_Click" width="25" tooltip="Save"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Save.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miEdit" click="miEdit_Click" width="25" tooltip="Edit"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Edit.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miDelete" click="miDelete_Click" width="25" tooltip="Delete"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Delete.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miPrintPreview" width="25" tooltip="Print Preview" click="miPrintPreview_Click"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Preview.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miPrint" tooltip="Print" width="25" click="miPrint_Click"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Print.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miWritXML" tooltip="Write XML" width="25" click="miWritXML_Click"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Write.png" Width="25"/> <separator style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"> <menuitem x:name="miHelp" tooltip="Help" width="25" click="miHelp_Click"> <menuitem.icon> <Image Source="/Opalus.Accounts;component/Images/Help.png" Width="25"/> <textbox borderthickness=".5" padding="5" foreground="Gray" x:name="Invoice_list_search_txt" margin="3,0,3,0"> HorizontalContentAlignment="Center" BorderBrush="#FF938686" TextChanged="Invoice_list_search_txt_TextChanged" Grid.Row="2" GotFocus="Invoice_list_search_txt_GotFocus" LostFocus="Invoice_list_search_txt_LostFocus" TabIndex="41"> <border cornerradius="8" width="Auto" grid.column="2" borderthickness="1" height="Auto"> <border.background> <lineargradientbrush> <gradientstop color="#FFFDFDFD" offset="0"> <gradientstop color="#FFDADADA" offset="1"> <grid width="Auto" margin="3"> <grid.resources> <Style TargetType="Label"> <setter property="Height" value="24"> </Style> <grid.rowdefinitions> <rowdefinition height="Auto"> <rowdefinition height="Auto"> <rowdefinition height="Auto"> <rowdefinition> <rowdefinition height="Auto"> <grid.columndefinitions> <columndefinition width="Auto"> <columndefinition width="100"> <columndefinition width="Auto"> <columndefinition width="Auto"> <columndefinition width="Auto"> <columndefinition width="Auto"> <columndefinition width="10"> <columndefinition width="Auto"> <columndefinition width="Auto"> <Label Content="Voucher No:" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" TabIndex="0" Width="75"/> <textbox x:name="TextVoucherNo" grid.row="0" grid.column="1" width="115" horizontalalignment="Left" height="24" maxlines="2" tabindex="2"> <ellipse grid.column="1" width="23" stroke="#FF8D7373"> <ellipse.fill> <lineargradientbrush endpoint="0.5,1" startpoint="0.5,0"> <gradientstop color="#FFC1B5B5" offset="1"> <gradientstop color="White" offset="0"> <Label Content="!" Width="18" Grid.Row="0" Grid.Column="1" TabIndex="3" Margin="4,0,0,0"> <Label.ToolTip> <tooltip content="Information" style="{StaticResource ResourceKey=CustomStyle}"> </Label.ToolTip> </Label> <Label Content="Date :" Grid.Column="3" Grid.Row="0" TabIndex="4" /> <datepicker width="105" height="25" x:name="dpJournalDate" grid.column="4" selecteddatechanged="dpJournalDate_SelectedDateChanged" isenabled="False" tabindex="5"> <Label Content="RF ID :" Grid.Row="0" Grid.Column="5" Height ="25" TabIndex="6" /> <textbox grid.row="0" grid.column="6" x:name="TextReferenceId" height="25" keydown="TextReferenceId_KeyDown" textchanged="TextReferenceId_TextChanged" tabindex="8"> <Label Content="Currency :" Grid.Column="7" Height="24" /> <n:currencycontrol x:name="ComboCurrency1" height="25" width="50" grid.column="9" grid.row="0" keydown="ComboCurrency1_KeyDown" tabindex="9" focusable="True" xmlns:n="#unknown"> <Label Content="Project :" Grid.Row="1" Height="24" TabIndex="12" VerticalAlignment="Bottom" /> <opale:opaletextbox name="TextProjects" grid.column="1" grid.row="1" height="24" textformat="Popup" popupdone="TextProjects_PopupDone" tabindex="14" xmlns:opale="#unknown"> <Label Content="" Name="lblAuto" Grid.Row="1" Grid.Column="6" Height="24" TabIndex="15" Width="100" HorizontalAlignment="Left" /> <Label Content="Auto Id :" Grid.Row="1" Grid.Column="5" TabIndex="16" /> <Label Content="Remarks :" Grid.Row="2" Grid.Column="0" TabIndex="17" /> <textbox x:name="TextRemarks" height="25" horizontalalignment="Left" grid.column="1" width="335" acceptsreturn="True"> TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" Grid.Row="2" TabIndex="19" /> <border borderthickness="1" cornerradius="6" grid.row="3" borderbrush="#9a9a9a" grid.columnspan="9" grid.rowspan="2"> <grid height="Auto"> <grid.rowdefinitions> <rowdefinition height="Auto"> <rowdefinition height="Auto"> <rowdefinition height="Auto"> <rowdefinition height="300"> <rowdefinition height="Auto"> <grid.columndefinitions> <columndefinition width="150"> <columndefinition width="250"> <columndefinition width="350"> <columndefinition width="100"> <columndefinition width="100"> <columndefinition> <Label Content="Account Code" Grid.Row="1" TabIndex="20" Grid.Column="0"/> <opale:opaletextbox name="TextAccountCode" textformat="Popup" grid.row="2" grid.column="0" popupdone="TextAccountCode_PopupDone" previewkeydown="TextAccountCode_PreviewKeyDown" tabindex="21" showcalendar="False" xmlns:opale="#unknown"> <Label Content="Account Name" Grid.Row="1" Grid.Column="1" TabIndex="22"/> <textbox name="TextAccountName" grid.row="2" grid.column="1" isreadonly="True" tabindex="23"> <Label Content="Description" Grid.Row="1" Grid.Column="2" TabIndex="24" /> <textbox name="TextDescription" grid.row="2" grid.column="2" tabindex="25" lostfocus="TextDescription_LostFocus"> <Label Content="Debit" Grid.Row="1" Grid.Column="3" TabIndex="26" /> <opale:opaletextbox name="TextDebit" grid.row="2" grid.column="3" xmlns:opale="#unknown"> LostFocus="TextDebit_LostFocus" TextChanged="TextDebit_TextChanged" TextFormat="Numeric" TabIndex="27" IsTabStop="True" TextAlignment="Right"/> <Label Content="Credit" Grid.Row="1" Grid.Column="4" TabIndex="28" /> <opale:opaletextbox name="TextCredit" grid.row="2" grid.column="4" lostfocus="TextCredit_LostFocus"> TextChanged="TextCredit_TextChanged" TabIndex="29" IsTabStop="True" /> <Button Name="btnAdd" Grid.Row="1" Grid.Column="4" Height="28" Width="25" HorizontalAlignment="Center" Margin="20,0,0,0" Click="btnAdd_Click" ToolTip="Add" TabIndex="30" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"> <Image Source="/Opalus.Accounts;component/Images/RecAdd.png" Stretch="UniformToFill"/> </Button> <Button Name="btnReset" Grid.Row="1" Grid.Column="4" Height="28" Width="25" HorizontalAlignment="Right" Click="btnReset_Click" ToolTip="Reset" TabIndex="30" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"> <Image Source="/Opalus.Accounts;component/Images/Refresh.png" Stretch="UniformToFill"/> </Button> <datagrid autogeneratecolumns="False" verticalscrollbarvisibility="Auto" horizontalscrollbarvisibility="Hidden" name="dgvTrans" rowheaderwidth="0"> ItemsSource="{Binding}" CanUserAddRows="False" TabIndex="32" CanUserSortColumns="False" CanUserReorderColumns="False" CanUserDeleteRows="True" GridLinesVisibility="Vertical" Grid.Row="3" HorizontalAlignment="Left" AlternatingRowBackground="#edf3fd" Rowremoved="#FFFFFF" VerticalGridLinesBrush="White" ColumnWidth="150" IsReadOnly="True" Width="Auto" Grid.Column="0" Grid.ColumnSpan="9" > <datagrid.resources> <Style TargetType="{x:Type DataGridRow}"> <setter property="Height" value="20"> </Style> <Style TargetType="{x:Type DataGridColumnHeader}"> <setter property="FontWeight" value="DemiBold"> </Style> <datagrid.columns> <datagridtextcolumn header="Account Code" width="150" binding="{Binding account_code}"> <datagridtextcolumn header="Account Name" width="250" binding="{Binding account_name}"> <datagridtextcolumn header="Description" width="350" binding="{Binding description}"> <datagridtextcolumn header="Debit" width="100" binding="{Binding debit, StringFormat=N2}"> <datagridtextcolumn.elementstyle> <Style TargetType="TextBlock"> <setter property="TextAlignment" value="Right"> </Style> <datagridtextcolumn header="Credit" width="100" binding="{Binding credit, StringFormat=N2}"> <datagridtextcolumn.elementstyle> <Style TargetType="TextBlock"> <setter property="TextAlignment" value="Right"> </Style> <datagridtextcolumn header="ID" binding="{Binding id_account_trans}" visibility="Collapsed"> <datagridtextcolumn header="IDAccount" binding="{Binding id_accounts}" visibility="Collapsed"> <datagridtextcolumn header="IDVocher" binding="{Binding id_voucher}" visibility="Collapsed"> <datagridtextcolumn header="IDAccountTransDate" binding="{Binding date}" visibility="Collapsed"> <datagridtextcolumn header="OpeningBalance" binding="{Binding opening_balance}" visibility="Collapsed"> <datagridtextcolumn header="ClosingBalance" binding="{Binding closing_balance}" visibility="Collapsed"> <datagridtextcolumn header="BaseDebit" binding="{Binding base_debit}" visibility="Collapsed"> <datagridtextcolumn header="BaseCredit" binding="{Binding base_cerdit}" visibility="Collapsed"> <datagridtextcolumn header="Currency" binding="{Binding currency}" visibility="Collapsed"> <datagridtextcolumn header="RefId" binding="{Binding ref_id}" visibility="Collapsed"> <datagridtextcolumn header="TransReferenceNo" binding="{Binding transfer_reference_number}" visibility="Collapsed"> <datagridtextcolumn header="RowType" binding="{Binding row_type}" visibility="Collapsed"> <datagridtextcolumn header="paymentMode" binding="{Binding payment_mode}" visibility="Collapsed"> <datagrid.contextmenu> <contextmenu> <menuitem name="TransEdit" header="Edit" click="TransEdit_Click"> <menuitem name="TransDelete" header="Delete" click="TransDelete_Click"> <stackpanel grid.row="4" grid.column="3" grid.columnspan="2" orientation="Horizontal"> <textbox> Width="100" IsReadOnly="True" Name="TextTotalDebit" TabIndex="33" FontFamily="Tahoma" FontSize="13" FontWeight="DemiBold" HorizontalContentAlignment="Right" /> <textbox grid.row="4" horizontalalignment="Right" grid.column="4" width="100"> IsReadOnly="True" Name="TextTotalCredit" TabIndex="34" FontFamily="Tahoma" FontSize="13" FontWeight="DemiBold" HorizontalContentAlignment="Right"/> <popup name="PopupReccurant" placement="MousePoint" allowstransparency="True" grid.column="0" grid.row="0" grid.columnspan="2"> <groupbox removed="#eef9fe" header="Reccuring details" margin="5" borderthickness="2" borderbrush="#bdd4df" width="Auto"> <grid height="Auto" removed="#eef9fe" margin="5"> <grid.columndefinitions> <columndefinition width="Auto"> <columndefinition width="Auto"> <columndefinition width="*"> <grid.rowdefinitions> <rowdefinition height="Auto"> <rowdefinition height="Auto"> <rowdefinition height="*"> <grid.resources> <Style TargetType="Label"> <setter property="Width" value="63"> </Style> <Style TargetType="TextBox"> <setter property="Height" value="25"> </Style> <Style TargetType="Button"> <setter property="Width" value="55"> <setter property="Height" value="25"> </Style> <Label Content="Duration" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left"/> <textbox name="TextDuration" width="150" grid.row="0" grid.column="1"> <Label Content="Frequency" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"/> <textbox name="TextFrequency" width="150" grid.row="1" grid.column="1"> <Button Name="btnReccurring" Content="Apply" Width="120" Grid.Row="2" Grid.Column="0" Grid.RowSpan="2" HorizontalAlignment="Center" Click="btnReccurring_Click" /> <Button Name="btnRecCancel" Content="Cancel" Width="120" Grid.Row="2" Grid.Column="1" Grid.RowSpan="2" HorizontalAlignment="Center" Click="btnRecCancel_Click" /> Please Check the Given Code. How Can i Avoid The Page Resizing Property推荐答案add ResizeMode="NoResize" to your xaml file to your xaml filexmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008"mc:Ignorable="d" Title="Journal Entry"xmlns:basic="clr-namespace:Opalus.Basic.Controls;assembly=Opalus.Basic.Controls"PreviewKeyDown="UserControl_PreviewKeyDown"xmlns:N="clr-namespace:Opalus.Accounts" removed="#FFF0F0F0"xmlns:opale="clr-namespace:Opale;assembly=Opale"ResizeMode="NoResize" // add this 这篇关于如何避免Wpf中的页面调整大小属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-16 11:15