내 문제는 String을 System.Drawing.Color로 구문 분석하려고한다는 것입니다. 간단한 메모장을 만들려고 시도 중입니다. 내 코드의 일부입니다.다시 ToString toString (Visual Basic 2008)
Private Sub ToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Colorfuente2.Click
Try
Dim cdlg As New ColorDialog
cdlg.ShowDialog()
cdlg.FullOpen = True
cdlg.AnyColor = True
ColorFuente1.Visible = True
Colorfuente2.Visible = False
If Windows.Forms.DialogResult.OK Then
RichTextBox1.ForeColor = cdlg.Color
reciente2.Text = cdlg.Color.ToString 'I've converted this tostring, so that recent colors are shown as text, this is what im trying to reverse
End If
Catch ex As Exception
End Try
End Sub
If Reciente1.Text = "Ninguno" Then
MessageBox.Show("No hay colores recientes", "Bloc de notas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Else : RichTextBox1.ForeColor = Reciente1.Text 'I get the error here, I have to change this text to a System.Drawing.Color.
End If
미리 감사드립니다.
그래, 고마워.하지만 이제는 또 다른 문제가 생겼어. "reciente1"을 누를 때마다 버튼 텍스트의 색 대신에 검은 색이된다. 누군가 내게 해결책을 줄 수 있다면 제발. 모두에게 미리 감사드립니다. – minimino