newsgroups-index (beta)

Current group: microsoft.public.cn.dotnet.languages.vb

控件的属性问题

控件的属性问题  
lehope
 Re: 控件的属性问题  
chanmmn
 =?gb2312?B?UmU6IL/YvP61xMr00NTOyszi?=  
Vince Yuan
 =?gb2312?B?UmU6IL/YvP61xMr00NTOyszi?=  
lehope
From:lehope
Subject:控件的属性问题
Date:Sat, 1 Jan 2005 20:16:31 +0800
无论点哪个按钮,结果都是FALSE 求助。谢谢。
Public Class UserControl1
Inherits System.Windows.Forms.UserControl

Windows 窗体设计器生成的代码
Public Property passed() As Boolean
Get

End Get
Set(ByVal Value As Boolean)

End Set
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.passed = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.passed = False
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
If Me.passed = True Then
MsgBox("me.passed=ture")
End If
If Me.passed = False Then
MsgBox("me.passed=false")
End If
End Sub
End Class
From:chanmmn
Subject:Re: 控件的属性问题
Date:Mon, 3 Jan 2005 22:46:38 +0800
You basically need to understand the getter and setter concept in
object-oriented programming.

chanmm

"lehope" wrote in message
news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl...
> 无论点哪个按钮,结果都是FALSE 求助。谢谢。
> Public Class UserControl1
> Inherits System.Windows.Forms.UserControl
>
> Windows 窗体设计器生成的代码
> Public Property passed() As Boolean
> Get
>
> End Get
> Set(ByVal Value As Boolean)
>
> End Set
> End Property
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Me.passed = True
> End Sub
>
> Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button2.Click
> Me.passed = False
> End Sub
>
> Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button3.Click
> If Me.passed = True Then
> MsgBox("me.passed=ture")
> End If
> If Me.passed = False Then
> MsgBox("me.passed=false")
> End If
> End Sub
> End Class
>
From:Vince Yuan
Subject:=?gb2312?B?UmU6IL/YvP61xMr00NTOyszi?=
Date:Sun, 2 Jan 2005 15:26:25 +0800
This is a multi-part message in MIME format.

------=_NextPart_000_004B_01C4F0DF.6C0EA990
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=C4=E3=BB=B9=C3=BB=D3=D0=D1=A7=BB=E1property=A1=A3=C6=E4=CA=B5property=D2=
=B2=CA=C7=BA=AF=CA=FD=A3=AC=D4=DA=C6=E4=D6=D0=B6=D4=C0=E0=C4=DA=B2=BF=B5=C4=
=CA=FD=BE=DD=B3=C9=D4=B1=BD=F8=D0=D0=B2=D9=D7=F7=A1=A3

=BC=FB=CF=C2=C3=E6=BA=EC=C9=AB=B4=FA=C2=EB=A3=BA

Vince

"lehope" =D0=B4=C8=EB=D3=CA=BC=FE =
news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl...
> =
=CE=DE=C2=DB=B5=E3=C4=C4=B8=F6=B0=B4=C5=A5=A3=AC=BD=E1=B9=FB=B6=BC=CA=C7F=
ALSE =C7=F3=D6=FA=A1=A3=D0=BB=D0=BB=A1=A3
> Public Class UserControl1
> Inherits System.Windows.Forms.UserControl
private m_passed as boolean
>=20
> Windows =B4=B0=CC=E5=C9=E8=BC=C6=C6=F7=C9=FA=B3=C9=B5=C4=B4=FA=C2=EB
> Public Property passed() As Boolean
> Get
> return m_passed
> End Get
> Set(ByVal Value As Boolean)
> m_passed =3D Value
> End Set
> End Property
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button1.Click
> Me.passed =3D True
> End Sub
>=20
> Private Sub Button2_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button2.Click
> Me.passed =3D False
> End Sub
>=20
> Private Sub Button3_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button3.Click
> If Me.passed =3D True Then
> MsgBox("me.passed=3Dture")
> End If
> If Me.passed =3D False Then
> MsgBox("me.passed=3Dfalse")
> End If
> End Sub
> End Class=20
>=20
>
------=_NextPart_000_004B_01C4F0DF.6C0EA990
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable








size=3D2>=C4=E3=BB=B9=C3=BB=D3=D0=D1=A7=BB=E1property=A1=A3=C6=E4=CA=B5pr=
operty=D2=B2=CA=C7=BA=AF=CA=FD=A3=AC=D4=DA=C6=E4=D6=D0=B6=D4=C0=E0=C4=DA=B2=
=BF=B5=C4=CA=FD=BE=DD=B3=C9=D4=B1=BD=F8=D0=D0=B2=D9=D7=F7=A1=A3
IV>
 

size=3D2>=BC=FB=CF=C2=C3=E6=BA=EC=C9=AB=B4=FA=C2=EB=A3=BA

 

Vince

 

"lehope" <href=3D"mailto:lehope_3@hotmail.com">size=3D2>lehope_3@hotmail.com> =
=D0=B4=C8=EB=D3=CA=BC=FE
href=3D"news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl">size=3D2>news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gblsize=3D2>...

> =
=CE=DE=C2=DB=B5=E3=C4=C4=B8=F6=B0=B4=C5=A5=A3=AC=BD=E1=B9=FB=B6=BC=CA=C7F=
ALSE =C7=F3=D6=FA=A1=A3=D0=BB=D0=BB=A1=A3
> Public Class=20
UserControl1
>     Inherits=20
System.Windows.Forms.UserControl

    private =
m_passed as=20
boolean

>
> Windows =
=B4=B0=CC=E5=C9=E8=BC=C6=C6=F7=C9=FA=B3=C9=B5=C4=B4=FA=C2=EB
> =
 Public Property=20
passed() As Boolean
>        =20
Get
>             =
color=3D#ff0000>return m_passed

>=20
        End Get
>=20
        Set(ByVal Value As =
Boolean)
>=20
            color=3D#ff0000>m_passed =3D Value
>=20
        End Set
> =
   =20
End Property
>     Private Sub Button1_Click(ByVal =
sender=20
As System.Object, ByVal e As
> System.EventArgs) Handles=20
Button1.Click
>         =
Me.passed =3D=20
True
>     End Sub
>
> =
   =20
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As =

>=20
System.EventArgs) Handles Button2.Click
>=20
        Me.passed =3D False
>=20
    End Sub
>
>     Private =
Sub=20
Button3_Click(ByVal sender As System.Object, ByVal e As
>=20
System.EventArgs) Handles Button3.Click
>=20
        If Me.passed =3D True =
Then
>=20
           =20
MsgBox("me.passed=3Dture")
> =
        End=20
If
>         If Me.passed =3D =
False=20
Then
> =
           =20
MsgBox("me.passed=3Dfalse")
> =
        End=20
If
>     End Sub
> End Class
> =

>=20


------=_NextPart_000_004B_01C4F0DF.6C0EA990--
From:lehope
Subject:=?gb2312?B?UmU6IL/YvP61xMr00NTOyszi?=
Date:Sun, 2 Jan 2005 18:36:50 +0800
This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C4F0FA.06113DE0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=D0=BB=D0=BB=B4=F3=CF=BA=A3=AC=BA=DC=D3=D0=D2=E2=CB=BC=A1=A3
"Vince Yuan" =
=D0=B4=C8=EB=CF=FB=CF=A2=D0=C2=CE=C5:Ord%23QuJ8EHA.1400@TK2MSFTNGP11.phx.=
gbl...
=
=C4=E3=BB=B9=C3=BB=D3=D0=D1=A7=BB=E1property=A1=A3=C6=E4=CA=B5property=D2=
=B2=CA=C7=BA=AF=CA=FD=A3=AC=D4=DA=C6=E4=D6=D0=B6=D4=C0=E0=C4=DA=B2=BF=B5=C4=
=CA=FD=BE=DD=B3=C9=D4=B1=BD=F8=D0=D0=B2=D9=D7=F7=A1=A3

=BC=FB=CF=C2=C3=E6=BA=EC=C9=AB=B4=FA=C2=EB=A3=BA

Vince

"lehope" =D0=B4=C8=EB=D3=CA=BC=FE =
news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl...
> =
=CE=DE=C2=DB=B5=E3=C4=C4=B8=F6=B0=B4=C5=A5=A3=AC=BD=E1=B9=FB=B6=BC=CA=C7F=
ALSE =C7=F3=D6=FA=A1=A3=D0=BB=D0=BB=A1=A3
> Public Class UserControl1
> Inherits System.Windows.Forms.UserControl
private m_passed as boolean
>=20
> Windows =B4=B0=CC=E5=C9=E8=BC=C6=C6=F7=C9=FA=B3=C9=B5=C4=B4=FA=C2=EB
> Public Property passed() As Boolean
> Get
> return m_passed
> End Get
> Set(ByVal Value As Boolean)
> m_passed =3D Value
> End Set
> End Property
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button1.Click
> Me.passed =3D True
> End Sub
>=20
> Private Sub Button2_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button2.Click
> Me.passed =3D False
> End Sub
>=20
> Private Sub Button3_Click(ByVal sender As System.Object, ByVal e =
As=20
> System.EventArgs) Handles Button3.Click
> If Me.passed =3D True Then
> MsgBox("me.passed=3Dture")
> End If
> If Me.passed =3D False Then
> MsgBox("me.passed=3Dfalse")
> End If
> End Sub
> End Class=20
>=20
>
------=_NextPart_000_0008_01C4F0FA.06113DE0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable








size=3D2>=D0=BB=D0=BB=B4=F3=CF=BA=A3=AC=BA=DC=D3=D0=D2=E2=CB=BC=A1=A3NT>

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Vince Yuan" < href=3D"mailto:shinebean@citiz.net">shinebean@citiz.net>=20
=
=D0=B4=C8=EB=CF=FB=CF=A2=D0=C2=CE=C5:Ord%23QuJ8EHA.1400@TK2MSFTNGP11.phx.=
gbl...

size=3D2>=C4=E3=BB=B9=C3=BB=D3=D0=D1=A7=BB=E1property=A1=A3=C6=E4=CA=B5pr=
operty=D2=B2=CA=C7=BA=AF=CA=FD=A3=AC=D4=DA=C6=E4=D6=D0=B6=D4=C0=E0=C4=DA=B2=
=BF=B5=C4=CA=FD=BE=DD=B3=C9=D4=B1=BD=F8=D0=D0=B2=D9=D7=F7=A1=A3
IV>
 

size=3D2>=BC=FB=CF=C2=C3=E6=BA=EC=C9=AB=B4=FA=C2=EB=A3=BA

 

Vince

 

"lehope" < href=3D"mailto:lehope_3@hotmail.com"> size=3D2>lehope_3@hotmail.com> =
=D0=B4=C8=EB=D3=CA=BC=FE
href=3D"news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl"> size=3D2>news:%23Yip6u$7EHA.3076@TK2MSFTNGP15.phx.gbl size=3D2>...

> =
=CE=DE=C2=DB=B5=E3=C4=C4=B8=F6=B0=B4=C5=A5=A3=AC=BD=E1=B9=FB=B6=BC=CA=C7F=
ALSE =C7=F3=D6=FA=A1=A3=D0=BB=D0=BB=A1=A3
> Public Class=20
UserControl1
>     Inherits=20
System.Windows.Forms.UserControl

    private =
m_passed as=20
boolean

>
> Windows =
=B4=B0=CC=E5=C9=E8=BC=C6=C6=F7=C9=FA=B3=C9=B5=C4=B4=FA=C2=EB
> =
 Public=20
Property passed() As Boolean
>=20
        Get
> =
   =20
        return=20
m_passed

>         End =

Get
>         Set(ByVal Value =
As=20
Boolean)
>         =
   =20
m_passed =3D Value
>=20
        End Set
> =
   =20
End Property
>     Private Sub =
Button1_Click(ByVal sender=20
As System.Object, ByVal e As
> System.EventArgs) Handles=20
Button1.Click
>         =
Me.passed =3D=20
True
>     End Sub
>
> =
   =20
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As =

>=20
System.EventArgs) Handles Button2.Click
>=20
        Me.passed =3D False
> =

    End Sub
>
>     Private =
Sub=20
Button3_Click(ByVal sender As System.Object, ByVal e As
>=20
System.EventArgs) Handles Button3.Click
>=20
        If Me.passed =3D True =
Then
>=20
           =20
MsgBox("me.passed=3Dture")
> =
       =20
End If
>         If Me.passed =
=3D False=20
Then
>=20
           =20
MsgBox("me.passed=3Dfalse")
> =
       =20
End If
>     End Sub
> End Class
> =

>=20


------=_NextPart_000_0008_01C4F0FA.06113DE0--
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum