示例#1
0
        private void MenuItem_Czcionka_Click(object sender, RoutedEventArgs e)
        {
            Font font = Font.ExtractFrom(textBox);

            if (WindowsFormsHelper.ChooseFont(ref font))
            {
                font.ApplyTo(textBox);
            }
        }
示例#2
0
 public void DragDropEffectsFromDragOperation()
 {
     Assert.AreEqual(DragDropEffects.Move, WindowsFormsHelper.ToDragDropEffects(DragOperations.Move));
     Assert.AreEqual(DragDropEffects.Copy, WindowsFormsHelper.ToDragDropEffects(DragOperations.Copy));
     Assert.AreEqual(DragDropEffects.Link, WindowsFormsHelper.ToDragDropEffects(DragOperations.Link));
     Assert.AreEqual(DragDropEffects.Scroll, WindowsFormsHelper.ToDragDropEffects(DragOperations.Scroll));
     Assert.AreEqual(DragDropEffects.All, WindowsFormsHelper.ToDragDropEffects(DragOperations.All));
     Assert.AreEqual(DragDropEffects.None, WindowsFormsHelper.ToDragDropEffects(DragOperations.None));
     // test also bitwise combined flags
     Assert.AreEqual(DragDropEffects.Move | DragDropEffects.Copy, WindowsFormsHelper.ToDragDropEffects(DragOperations.Move | DragOperations.Copy));
 }
示例#3
0
        private void MenuItem_KolorTła_Click(object sender, RoutedEventArgs e)
        {
            Color kolorTła = Colors.White;

            if (textBox.Background is SolidColorBrush)
            {
                kolorTła = (textBox.Background as SolidColorBrush).Color;
            }
            if (WindowsFormsHelper.ChooseColor(ref kolorTła))
            {
                textBox.Background = new SolidColorBrush(kolorTła);
            }
        }