private void MenuItem_Czcionka_Click(object sender, RoutedEventArgs e) { Font font = Font.ExtractFrom(textBox); if (WindowsFormsHelper.ChooseFont(ref font)) { font.ApplyTo(textBox); } }
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)); }
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); } }