コード例 #1
0
        /// <summary>
        /// Swaps the two split controls with the given indices.
        /// </summary>
        private void Swap(int index1, int index2)
        {
            SplitControl control1 = (SplitControl)splitControls[index1];
            SplitControl control2 = (SplitControl)splitControls[index2];

            Point temporaryLocation = control1.Location;

            control1.Location = control2.Location;
            control2.Location = temporaryLocation;

            splitControls.SetChildIndex(control1, index2);
            splitControls.SetChildIndex(control2, index1);

            ToggleButtons(control1, index2);
            ToggleButtons(control2, index1);

            control1.Index = index2 + 1;
            control2.Index = index1 + 1;
        }
コード例 #2
0
        private void SortThumbs()
        {
            IEnumerable <Thumb> sortedList = from thumb in myControls.Cast <Thumb>()
                                             orderby thumb.DisplayName, thumb.FullPath
            select thumb;
            int counter = 0;

            foreach (Thumb thumb in sortedList)
            {
                myControls.SetChildIndex(thumb, counter);
                counter++;
            }
        }
コード例 #3
0
ファイル: DigitList.cs プロジェクト: s151910/MaxLib
 public void Insert(int index, DigitViewer item)
 {
     controls.Add(item);
     controls.SetChildIndex(item, index);
     Owner.UpdateSort();
 }