/// <summary> /// /// </summary> /// <param name="flag">1=width;2=height;0=all</param> private void SameSize(int flag) { if (axSuitSchemeView1.ActivedSchemeItem == null || axSuitSchemeView1.SelectedAxSchemeItems.Count <= 0) { return; } Size size = axSuitSchemeView1.ActiveControl.Size; AxSchemeItemCollection items = axSuitSchemeView1.SelectedAxSchemeItems; foreach (AxSchemeItem item in items) { if (item.Name != axSuitSchemeView1.ActiveControl.Name && !item.Locked) { if (flag == 1) { item.Size = new Size(size.Width, item.Size.Height); } else if (flag == 2) { item.Size = new Size(item.Size.Width, size.Height); } else { item.Size = size; } } } }
/// <summary> /// /// </summary> /// <param name="flag">1=left;2=right;3=center;4=top;5=bottom;6=middle</param> private void SameLocation(int flag) { if (axSuitSchemeView1.ActivedSchemeItem == null || axSuitSchemeView1.SelectedAxSchemeItems.Count <= 0) { return; } Point loca = axSuitSchemeView1.ActiveControl.Location; Size size = axSuitSchemeView1.ActiveControl.Size; AxSchemeItemCollection items = axSuitSchemeView1.SelectedAxSchemeItems; foreach (AxSchemeItem item in items) { if (item.Name != axSuitSchemeView1.ActiveControl.Name && !item.Locked) { if (flag == 1) { item.Location = new Point(loca.X, item.Location.Y); } else if (flag == 2) { item.Location = new Point((loca.X + size.Width) - item.Size.Width, item.Location.Y); } //else if (flag == 3) //{ // item.Location = new Point(item.Location.Width, loca.Height); //} else if (flag == 4) { item.Location = new Point(item.Location.X, loca.Y); } else if (flag == 5) { item.Location = new Point(item.Location.X, (loca.Y + size.Height) - item.Size.Height); } //else if (flag == 6) // item.Location = new Point(); else { return; } } } }