Re: [.NET] 我是新手想問如何做自訂控制項..

看板Visual_Basic作者 (要公理要正義)時間16年前 (2010/02/08 17:00), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串2/3 (看更多)
※ 引述《easterday (....)》之銘言: : 1. Select the template Windows Control Library Windows Form控制項程式庫 : 2. Start by renaming the UserControl1 object 把UserControl1.vb : to FocusedTextBox rename成FocusedTextBox.vb : 3. 把Public Class UserControl1改成 同左 : Public Class FocusedTextBox : 4. 把Inherits System.Windows.Forms.Usercontrol 我找不到這些字,就自己打吧 : 改成Inherits TextBox : 5. (none) 編譯器好像找不到TextBox : ,所以自己手動加入 : Imports : System.Windows.Forms 我試了一遍, 你除了自己Inherits System.Windows.Forms.TextBox之外, 你還要把 FocusedTextBox.desinger.vb一檔內的Inherits System.Windows.Forms.UserControl 改成Inherits System.Windows.Forms.TextBox, 這樣編譯就會過了,不過我RUN時會發生 Exception(dll內未含UserControl型別錯誤), 有解嗎? -- http://charity0207.googlepages.com/index.htm 每天點一下,每天做公益。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.33.123.86

02/08 23:49, , 1F
你是怎麼改的呀?我另外開notepad來改好像還是不行..
02/08 23:49, 1F

02/09 13:54, , 2F
在方案總管上方按顯示所有檔案, 就可以找到*.designer.vb
02/09 13:54, 2F
文章代碼(AID): #1BRzB15U (Visual_Basic)
文章代碼(AID): #1BRzB15U (Visual_Basic)