作者horngsh (要公理要正義)
看板Visual_Basic
標題Re: [.NET] 我是新手想問如何做自訂控制項..
時間Mon Feb 8 17:00:45 2010
※ 引述《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
推 easterday:你是怎麼改的呀?我另外開notepad來改好像還是不行.. 02/08 23:49
→ horngsh:在方案總管上方按顯示所有檔案, 就可以找到*.designer.vb 02/09 13:54