-1
我做了,直到我做了更改,一直致力於精細的用戶控制 - 我改變了它從這個:VB.NET沒有構造發現自定義控件
Public Sub New()
InitializeComponent()
End Sub
這樣:
Public Sub New(Optional ViewMode As Boolean = False, Optional sMaterial As String = "", Optional sCost As String = "", Optional sQuantity As String = "", Optional bOnOrder As String = "", Optional bDelivered As String = "")
InitializeComponent()
currMaterial = sMaterial
currCost = sCost
currQuantity = sQuantity
currOnOrder = bOnOrder
currDelivered = bDelivered
currViewmode = ViewMode
End Sub
我需要能夠寫入控件和存儲值,但現在我添加了這個,我得到了「No Constructor Found」錯誤。我究竟做錯了什麼?
我假設任何構建控制結構,需要一個無參數的構造函數。 – TZHX
它似乎是這樣的,因爲當我刪除參數時,它工作正常。但我需要有參數? – SilverShotBee
然後有多個構造函數? – TZHX