读书人

VB.NET里面的简单二小个有关问题

发布时间: 2012-03-31 13:13:26 作者: rapoo

VB.NET里面的简单二小个问题

1:

VB.NET code
  Protected Property id()        Get        End Get        Set(ByVal value)        End Set    End Property


怎么样写完整
这个怎么用啊, 怎么调到Get方法和Set方法


2 VB.NET怎么样强制类型转换啊??

java中是: int aa = (int)11.1

vb.net 应该怎么写啊

[解决办法]
第一个我记不太清楚了,

回答一下第二个

VB.NET code
int aa = CInt(11.1)
[解决办法]
第一个试试这样行不.
VB.NET code
Private Kabuid As String Public Property id() As String Get Return Kabuid End Get Set(ByVal value As String) Kabuid = value End Set
[解决办法]
第一个是设置一个类的属性,像text控件的text属性一样
Protected Property id()
Get
return id
End Get
Set(ByVal value)
id=value
End Set
End Property
y就可以用了
[解决办法]
探讨
引用:
第一个我记不太清楚了,

回答一下第二个


VB.NET codeint aa = CInt(11.1)


我的是自定义类咯,这边只是举个例子,而已

[解决办法]
这个~~~东西,叫结构~~~吧~我是来打酱油的
[解决办法]
VB.NET code
Public Class aa    Private user As String    Public Property use()        Get            Return user        End Get        Set(ByVal value)            user = value        End Set    End PropertyEnd ClassPublic Class bb    Public Sub check()        Dim a As New aa        a.use = "abc"        Debug.Print(a.use)    End SubEnd Class
[解决办法]
VB.NET怎么样强制类型转换啊??

java中是: int aa = (int)11.1

VB.NET CODE:
Dim aa As Integer = CType(11.1, Integer)
[解决办法]
Dim a As Integer = Int(11.1)
Dim b As Integer = CInt(11.1)
Dim c As Integer = CType(11.1, Integer)
Dim d As Integer = Convert.ToInt32(11.1)
Dim f As Integer = Val(11.1)
[解决办法]
探讨
Dim a As Integer = Int(11.1)
Dim b As Integer = CInt(11.1)
Dim c As Integer = CType(11.1, Integer)
Dim d As Integer = Convert.ToInt32(11.1)
Dim f As Integer = Val(11.1)

读书人网 >VB Dotnet

热点推荐