コード例 #1
0
 private void rulerGauge_PointerDragMove(object sender, PointerDragEventArgs e)
 {
     e.Pointer.UpdateValue(Math.Max(e.NewValue, 0), 10);
     if (e.Pointer.Name == "LeftIndent")
     {
         _firstLinePointer.Value = Math.Max(e.Pointer.Value - richTextBox1.SelectionHangingIndent, 0);
     }
     else if (e.Pointer.Name == "RightIndent")
     {
         if (Convert.ToInt32(e.Pointer.Value) > richTextBox1.RightMargin)
         {
             e.Pointer.Value = richTextBox1.RightMargin;
         }
     }
 }
コード例 #2
0
        private void rulerGauge_PointerDragEnd(object sender, PointerDragEventArgs e)
        {
            int m, n = Convert.ToInt32(e.Pointer.Value);

            switch (e.Pointer.Name)
            {
            case "LeftIndent":
                m  = richTextBox1.SelectionHangingIndent;
                n -= m;
                if (n >= 0)
                {
                    richTextBox1.SelectionIndent        = n;
                    richTextBox1.SelectionHangingIndent = m;
                }
                else
                {
                    richTextBox1.SelectionIndent         = 0;
                    richTextBox1.SelectionHangingIndent += n;
                }
                _firstLinePointer.Value = richTextBox1.SelectionIndent;
                break;

            case "FirstLineIndent":
                m = richTextBox1.SelectionHangingIndent + richTextBox1.SelectionIndent - n;
                richTextBox1.SelectionIndent        = n;
                richTextBox1.SelectionHangingIndent = m;
                break;

            case "HangingIndent":
                richTextBox1.SelectionHangingIndent = n - richTextBox1.SelectionIndent;
                break;

            case "RightIndent":
                m = Math.Max(richTextBox1.RightMargin - n, 0);
                richTextBox1.SelectionRightIndent = m;
                _rIndentPointer.Value             = richTextBox1.RightMargin - m;
                break;

            case "RightMargin":
                m = richTextBox1.SelectionRightIndent;
                richTextBox1.RightMargin          = n;
                richTextBox1.SelectionRightIndent = m;
                break;
            }
        }
コード例 #3
0
 private void c1RadialGauge2_PointerDragMove(object sender, PointerDragEventArgs e)
 {
     SetNewValue2(e.NewValue);
 }
コード例 #4
0
 private void c1RadialGauge1_PointerDragMove(object sender, PointerDragEventArgs e)
 {
     e.Pointer.Value = e.NewValue;
 }
コード例 #5
0
 private void c1LinearGauge1_PointerDragMove(object sender, PointerDragEventArgs e)
 {
     e.Pointer.UpdateValue(e.NewValue, 1.0);
 }