Hi to all,
As a beginner in VB please let me ask some questions.
I hope that somebody can help me.
I use Visual Studio 2003 in Windows 2000 and .NET framework 1.0
I have a code like this :
------------------
Private Sub cbxBold_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxBold.CheckedChanged
If tbxTeks.Font.Bold Then
tbxTeks.Font = New System.Drawing.Font(tbxTeks.Font, tbxTeks.Font.Style Xor FontStyle.Bold)
Else
tbxTeks.Font = New System.Drawing.Font(tbxTeks.Font, tbxTeks.Font.Style Or FontStyle.Bold)
End If
End Sub
------------------
-->tbxTeks is a TextBox.
The goal of this code is the change the font in a textbox tbxTeks.
If the checkbox cbxBold checked or unchecked, the text in the textbox tbxTeks should change.
When I run this code, I got an error message as follow :
---------------
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
---------------
I have tried many ways, but the error always occurs at the line where the NEW take place.
Can you help me please ?
Thanks in advance for helping me.
Regards,
Juliando.
As a beginner in VB please let me ask some questions.
I hope that somebody can help me.
I use Visual Studio 2003 in Windows 2000 and .NET framework 1.0
I have a code like this :
------------------
Private Sub cbxBold_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxBold.CheckedChanged
If tbxTeks.Font.Bold Then
tbxTeks.Font = New System.Drawing.Font(tbxTeks.Font, tbxTeks.Font.Style Xor FontStyle.Bold)
Else
tbxTeks.Font = New System.Drawing.Font(tbxTeks.Font, tbxTeks.Font.Style Or FontStyle.Bold)
End If
End Sub
------------------
-->tbxTeks is a TextBox.
The goal of this code is the change the font in a textbox tbxTeks.
If the checkbox cbxBold checked or unchecked, the text in the textbox tbxTeks should change.
When I run this code, I got an error message as follow :
---------------
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
---------------
I have tried many ways, but the error always occurs at the line where the NEW take place.
Can you help me please ?
Thanks in advance for helping me.
Regards,
Juliando.