[英]VB.NET - ReDim “Comma, ')', or a valid expression continuation expected.”
我是VB的新手,目前正在更新到VB.net。
我Comma, ')', or a valid expression continuation expected.
錯誤Comma, ')', or a valid expression continuation expected.
在此行的“ To
部分:
ReDim m_ctrCurrentPositions(0 To m_frmResize.Controls.Count -1)
其中m_ctrCurrentPositions
定義為:
Private m_ctrCurrentPositions As ControlPositionType
經過一番閱讀后,我認為錯誤與(0 To Count-1)
,參數應該只是(Count-1)
嗎? 還是這個說法不對?
為了更改任何數組的大小,您必須傳遞一個INTEGER作為參數。
我相信您要查找的語句是:
ReDim m_ctrCurrentPositions(m_frmResize.Controls.Count-1)
另外,如果要將值保留在數組中,則將要使用Preserve
關鍵字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.