小编min*_*ino的帖子

ToString再次回到颜色(Visual Basic 2008)

我的问题是我正在尝试将String解析为System.Drawing.Color.我试图设置一个简单的记事本,这是我的代码的一部分:

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 …
Run Code Online (Sandbox Code Playgroud)

.net vb.net string visual-studio

2
推荐指数
1
解决办法
4433
查看次数

标签 统计

.net ×1

string ×1

vb.net ×1

visual-studio ×1