タイトル : Re^4: 同時書式設定 投稿日 : 2007/12/08(Sat) 12:03 投稿者 : マリオ
Dim fontstyle As FontStyle = Drawing.FontStyle.Regular '太字の設定 If ToolStripButton1.CheckState = CheckState.Checked Then fontstyle = Drawing.FontStyle.Bold End If ’イタリック体 If ToolStripButton2.CheckState = CheckState.Checked Then fontstyle = fontstyle Or Drawing.FontStyle.Italic End If ’下線 If ToolStripButton3.CheckState = CheckState.Checked Then fontstyle = fontstyle Or Drawing.FontStyle.Underline End If ’取り消し線 If ToolStripButton14.CheckState = CheckState.Checked Then fontstyle = fontstyle Or Drawing.FontStyle.Strikeout End If Me.RichTextBox1.SelectionFont = New Font (Me.RichTextBox1.SelectionFont.FontFamily, Me.RichTextBox1.SelectionFont.Size, fontstyle) こんな風にツールボタンのチェックステートの状態に応じて スタイルを組み合わせられる仕組みにしたらどうでしょう。 |