vb中的Type类型转换到vb.net怎么转,大家帮帮忙。
vb中定义Type类型如下:
Type STOCK_SEARCH
StockStat As Variant
RollLen As Variant
McKind As Variant
End Type
将它拷到.net中,提示要如下定义:
Structure STOCK_SEARCH
StockStat As Variant
RollLen As Variant
McKind As Variant
End Structure
可是改后程序仍提示有错,说STOCK_SEARCH没有定义
[解决办法]
Structure STOCK_SEARCH
dim StockStat As object
dim RollLen As object
dim McKind As object
End Structure
[解决办法]
回楼上:
这个方法不行.
在VB.net的Structure中,不允许对字段直接实例化。只能在Structure的带参数的构造函数中对字段进行初始化。