void FontOnClick(object sender, RoutedEventArgs args) { FontDialog dlg = new FontDialog(); dlg.Owner = this; dlg.Typeface = face; if (dlg.ShowDialog().GetValueOrDefault()) { face = dlg.Typeface; } }
void ButtonOnClick(object sender, RoutedEventArgs args) { FontDialog dlg = new FontDialog(); dlg.Owner = this; dlg.Typeface = new Typeface(FontFamily, FontStyle, FontWeight, FontStretch); dlg.FontSize = FontSize; if (dlg.ShowDialog().GetValueOrDefault()) { FontFamily = dlg.Typeface.FontFamily; FontStyle = dlg.Typeface.Style; FontWeight = dlg.Typeface.Weight; FontStretch = dlg.Typeface.Stretch; FontSize = dlg.FaceSize; } }
// Font item event handler. void FontOnClick(object sender, RoutedEventArgs args) { FontDialog dlg = new FontDialog(); dlg.Owner = this; // Set TextBox properties in FontDialog. dlg.Typeface = new Typeface(txtbox.FontFamily, txtbox.FontStyle, txtbox.FontWeight, txtbox.FontStretch); dlg.FaceSize = txtbox.FontSize; if (dlg.ShowDialog().GetValueOrDefault()) { // Set FontDialog properties in TextBox. txtbox.FontFamily = dlg.Typeface.FontFamily; txtbox.FontSize = dlg.FaceSize; txtbox.FontStyle = dlg.Typeface.Style; txtbox.FontWeight = dlg.Typeface.Weight; txtbox.FontStretch = dlg.Typeface.Stretch; } }
void FontOnclick(object sender, RoutedEventArgs args) { //Fontdialog 생성... FontDialog dlg = new FontDialog(); dlg.Owner = this; //폰트 대화상자의 텍스트 박스 프로퍼티를 설정 dlg.TypeFace = new Typeface(txtbox.FontFamily, txtbox.Fontstyle, txtbox.FontWeight, txtbox.FontStretch); dlg.FaceSize = txtbox.Fontsize; if (dlg.showdialog().GetValueOrDefault()) { //폰트 대화상자 프로퍼티를 텍스트 박스에 설정 txtbox.FontFamily = dlg.TypeFace.FontFamily; txtbox.FontSize = dlg.FaceSize; txtbox.FontStyle = dlg.Typeface.Style; txtbox.FontWeight = dlg.Typeface.Weight; txtbox.FontStretch = dlg.Typeface.stretch; } }