private void EmOrderReturnAddressCtrl_Removed(EmOrderReturnAddressCtrl obj) { if (GlobalMessageBox.Show("删除该条收货地址?", "提示", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } skinFlowLayoutPanel1.Controls.Remove(obj); Remove(obj.Address); }
private void EmOrderReturnAddressCtrl_CheckChanged(EmOrderReturnAddressCtrl obj) { //被选中了 result = obj.Address; foreach (var item in skinFlowLayoutPanel1.Controls) { if (item is EmOrderReturnAddressCtrl) { EmOrderReturnAddressCtrl addressCtrl = item as EmOrderReturnAddressCtrl; if (addressCtrl.Address != result) { addressCtrl.SetRadio(false); } } } }
private void BindingDataSource(List <EmRefundAddress> list) { skinFlowLayoutPanel1.Controls.Clear(); //第一条是最上面的 //其他就是下面的内容你给 if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { if (list[i].IsDefault) { result = list[i]; } EmOrderReturnAddressCtrl ctrl = new EmOrderReturnAddressCtrl(list[i]); ctrl.Selected += EmOrderReturnAddressCtrl_CheckChanged; ctrl.Removed += EmOrderReturnAddressCtrl_Removed; ctrl.Updated += EmOrderReturnAddressCtrl_Update; skinFlowLayoutPanel1.Controls.Add(ctrl); } } }
private void EmOrderReturnAddressCtrl_Update(EmOrderReturnAddressCtrl obj) { Update(obj.Address); }