Article View: pl.comp.lang.vbasic
Article #104933Problem ze zmodyfikowanym checkboxem..
From: Grzegorz Piziak
Date: Mon, 03 Dec 2012 22:14
Date: Mon, 03 Dec 2012 22:14
34 lines
2068 bytes
2068 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.
Technical Details
Message-ID:
<b28b7a6f-77c7-4d2c-aa55-888a24275ec3@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!proxad.net!feeder1-2.proxad.net!209.85.216.87.MISMATCH!c8no103431qao.0!news-out.google.com!gf5ni47564750qab.0!nntp.google.com!c8no105702qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Received: by 10.224.180.141 with SMTP id bu13mr6543845qab.2.1354572843921; Mon, 03 Dec 2012 14:14:03 -0800 (PST) Received: by 10.49.60.40 with SMTP id e8mr2542528qer.40.1354572843889; Mon, 03 Dec 2012 14:14:03 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!proxad.net!feeder1-2.proxad.net!209.85.216.87.MISMATCH!c8no103431qao.0!news-out.google.com!gf5ni47564750qab.0!nntp.google.com!c8no105702qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.vbasic Date: Mon, 3 Dec 2012 14:14:03 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=178.37.156.162; posting-account=9x_bbQoAAADsBHimj8merfooOc7QCErg NNTP-Posting-Host: 178.37.156.162 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <b28b7a6f-77c7-4d2c-aa55-888a24275ec3@googlegroups.com> Subject: Problem ze zmodyfikowanym checkboxem.. From: Grzegorz Piziak <gpiziak@gmail.com> Injection-Date: Mon, 03 Dec 2012 22:14:03 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit