我有一个 ComboEdit,其中显示了 Country List。在表单上,它们是一个 ADDRESS 选项卡,在选择 ComboEdit 值时设置为活动状态。ADDRESS 选项卡上控件的位置必须根据指定的布局进行更改(我们可以在此处使用数据库来根据所选国家/地区存储布局)。
我想根据从组合编辑中选择的公司指定的订单动态显示地址格式和控件。请参阅不同的地址格式:http: //msdn.microsoft.com/en-us/library/cc195167.aspx。
我想根据所选国家/地区更改控件的更改位置。有什么建议/想法吗? 目前我正在使用两个不同的网格并根据国家价值使可见/隐藏。这对于一两个国家来说是可以的,但不可能添加那么多网格,所以希望将其存储到数据库中。请建议我正确的方法...!
<Grid Name="grdGroupA" Visibility="Hidden" Margin="0,0,95,21" HorizontalAlignment="Right" Width="714">
<Label Content="Honorific" HorizontalAlignment="Left" Margin="18,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtAHonorific" HorizontalAlignment="Left" Margin="134,31,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtAHonorific_LostFocus"/>
<dxe:TextEdit Name="txtAFirstName" HorizontalAlignment="Left" Margin="309,31,0,0" VerticalAlignment="Top" Width="64" LostFocus="txtAFirstName_LostFocus"/>
<Label Content="First Name" HorizontalAlignment="Left" Margin="242,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtAMiddleName" Margin="0,31,185,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="64" LostFocus="txtAMiddleName_LostFocus"/>
<Label Content="Middle Name" HorizontalAlignment="Left" Margin="378,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtALastName" HorizontalAlignment="Right" Margin="0,31,35,0" VerticalAlignment="Top" Width="64" LostFocus="txtALastName_LostFocus"/>
<Label Content="Last Name" Margin="0,27,99,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="66" RenderTransformOrigin="-0.045,0.577"/>
<Label Content="Company Name" HorizontalAlignment="Left" Margin="18,58,0,0" VerticalAlignment="Top" Width="100"/>
<dxe:TextEdit Name="txtACompanyName" HorizontalAlignment="Left" Margin="134,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<Label Content="Address1" HorizontalAlignment="Left" Margin="18,84,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtAAddress1" HorizontalAlignment="Left" Margin="134,85,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtAAddress1_LostFocus"/>
<Label Content="Address2" HorizontalAlignment="Left" Margin="18,108,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtAAddress2" HorizontalAlignment="Left" Margin="134,112,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtAAddress2_LostFocus"/>
<Label Content="City" HorizontalAlignment="Left" Margin="18,135,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtACity" HorizontalAlignment="Left" Margin="134,139,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtACity_LostFocus"/>
<Label Content="State" HorizontalAlignment="Left" Margin="242,135,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtAState" HorizontalAlignment="Left" Margin="290,135,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtAState_LostFocus"/>
<Label Content="Postal Code" HorizontalAlignment="Left" Margin="410,131,0,0" VerticalAlignment="Top" Width="77"/>
<dxe:TextEdit Name="txtAPostalCode" HorizontalAlignment="Left" Margin="487,131,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95" LostFocus="txtAPostalCode_LostFocus"/>
<Button Content="Save" Visibility="Hidden" Name="BtnASave" HorizontalAlignment="Left" Height="30" Margin="330,172,0,0" VerticalAlignment="Top" Width="75" Click="BtnASave_Click"/>
<Button Content="Cancel" Name="BtnACancel" HorizontalAlignment="Left" Height="30" Margin="492,172,0,0" VerticalAlignment="Top" Width="75" Click="BtnACancel_Click"/>
<Button Content="Update" Visibility="Hidden" x:Name="BtnAEdit" HorizontalAlignment="Left" Height="30" Margin="410,172,0,0" VerticalAlignment="Top" Width="75" Click="BtnAEdit_Click_1"/>
<Button Content="Add New" x:Name="BtnAAddNew" HorizontalAlignment="Left" Height="30" Margin="250,172,0,0" VerticalAlignment="Top" Width="75" Click="BtnAAddNew_Click"/>
<Label Content="*" x:Name="lblAHonorificError" Foreground="Red" HorizontalAlignment="Left" Margin="227,31,0,0" VerticalAlignment="Top"/>
<!--<Label Content="*" x:Name="lblAHonorificError_Copy" Foreground="Red" HorizontalAlignment="Left" Margin="227,57,0,0" VerticalAlignment="Top"/>-->
<Label Content="*" x:Name="lblAAddress1Error" Foreground="Red" HorizontalAlignment="Left" Margin="227,84,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblAAddress2Error" Foreground="Red" HorizontalAlignment="Left" Margin="226,112,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblACityError" Foreground="Red" HorizontalAlignment="Left" Margin="226,138,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblAStateError" Foreground="Red" HorizontalAlignment="Left" Margin="384,134,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblAPostalCodeError" Foreground="Red" HorizontalAlignment="Left" Margin="581,130,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblAFirstNameError" Foreground="Red" HorizontalAlignment="Left" Margin="370,30,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblAMiddleNameError" Foreground="Red" HorizontalAlignment="Left" Margin="529,31,0,0" VerticalAlignment="Top"/>
<Label Content="*" x:Name="lblALastNameError" Foreground="Red" HorizontalAlignment="Left" Margin="677,29,0,0" VerticalAlignment="Top"/>
</Grid>
<Grid Name="grdGroupB" Visibility="Visible" Margin="0,0,141,21" HorizontalAlignment="Right" Width="668">
<Label Content="Honorific" HorizontalAlignment="Left" Margin="18,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtBHonorific" HorizontalAlignment="Left" Margin="134,31,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<dxe:TextEdit Name="txtBFirstName" HorizontalAlignment="Left" Margin="309,31,0,0" VerticalAlignment="Top" Width="64"/>
<Label Content="First Name" HorizontalAlignment="Left" Margin="242,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtBMiddleName" Margin="0,27,144,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="64"/>
<Label Content="Middle Name" HorizontalAlignment="Left" Margin="378,27,0,0" VerticalAlignment="Top"/>
<dxe:TextEdit Name="txtBLastName" HorizontalAlignment="Right" Margin="0,27,10,0" VerticalAlignment="Top" Width="64"/>
<Label Content="Last Name" Margin="0,27,73,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="66"/>
<Label Content="Company Name" HorizontalAlignment="Left" Margin="18,53,0,0" VerticalAlignment="Top" Width="100"/>
<dxe:TextEdit Name="txtBCompanyName" HorizontalAlignment="Left" Margin="134,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<Label Content="Address1" HorizontalAlignment="Left" Margin="18,84,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtBAddress1" HorizontalAlignment="Left" Margin="134,85,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<Label Content="Address2" HorizontalAlignment="Left" Margin="18,108,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtBAddress2" HorizontalAlignment="Left" Margin="134,112,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<Label Content="City" HorizontalAlignment="Left" Margin="18,135,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtBCity" HorizontalAlignment="Left" Margin="134,139,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="95"/>
<Label Content="State" HorizontalAlignment="Left" Margin="250,58,0,0" VerticalAlignment="Top" Width="59"/>
<dxe:TextEdit Name="txtBState" HorizontalAlignment="Left" Margin="309,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="64"/>
<Label Content="Postal Code" HorizontalAlignment="Left" Margin="378,58,0,0" VerticalAlignment="Top" Width="77"/>
<dxe:TextEdit Name="txtBPostalCode" HorizontalAlignment="Left" Margin="460,54,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1,0.091" Width="64"/>
<Button Content="Save" Name="BtnBSave" HorizontalAlignment="Left" Height="30" Margin="412,172,0,0" VerticalAlignment="Top" Width="75"/>
<Button Content="Cancel" Name="BtnBCancel" HorizontalAlignment="Left" Height="30" Margin="492,172,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>
与 Grid 中的所有控件一样。如何根据所选国家/地区设置位置?
帮助赞赏!谢谢!