作者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
1F:推 easterday:你是怎麽改的呀?我另外开notepad来改好像还是不行.. 02/08 23:49
2F:→ horngsh:在方案总管上方按显示所有档案, 就可以找到*.designer.vb 02/09 13:54