🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.vbasic
2 messages
2 total messages Started by Grzegorz Piziak Mon, 03 Dec 2012 14:14
Problem ze zmodyfikowanym checkboxem..
#102453
Author: Grzegorz Piziak
Date: Mon, 03 Dec 2012 14:14
36 lines
882 bytes
Witam,
dlaczego w poni¿szym otrzymujê b³±d:

System.InvalidCastException: Nie mo¿na rzutowaæ obiektu typu 'System.Windows.Forms.CheckBox' na typ 'statmbp.checkboxyn'.

W kodzie designera zmieniam t± linijkê:
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
na
Friend WithEvents CheckBox1 As CheckboxYN

W momencie startu programu otrzymujê powy¿szy b³±d.

Public Class CheckboxYN
    Inherits System.Windows.Forms.CheckBox
    Public Property YesNo As String
        Get
            If Me.checked Then
                Return "Y"
            Else
                Return "N"
            End If
        End Get
        Set(value As String)
            If Me.Checked Then
                Me.Checked = True
            Else
                Me.Checked = False
            End If
        End Set
    End Property
End Class

Pozdrawiam,
Grzegorz.

Re: Problem ze zmodyfikowanym checkboxem..
#102454
Author: Grzegorz Piziak
Date: Mon, 03 Dec 2012 14:22
6 lines
100 bytes
Bo trzeba jeszcze to zmieniæ:

Me.CheckBox1 = New System.Windows.Forms.CheckBox()

Dobranoc...

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads