有关在Visual Studio 2013中复制VB 6控件行为的问题 [英] Question about replicating VB 6 control behavior in Visual Studio 2013

查看:113
本文介绍了有关在Visual Studio 2013中复制VB 6控件行为的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这听起来像是一个非常愚蠢的问题,我会提前道歉。

I apologize in advance if this sound like a really dumb question.

编程对我来说是一种爱好,因此,我从来没有过度投入过激励转换出VB6的大量时间仅仅是因为我需要做的大部分编程都可以在VB6中完成(主要是解析工具)。但是,我需要让
跳。所以我一直在尝试在Visual Studio中做所有事情。 回到VB6版本,我经常会创建一个控件,然后复制该控件,为控件分配和索引值,这样我就可以输入该控件的公共代码,然后将
应用于所有实例(我是这样的黑客我甚至不知道这个技术术语。这样做的一个例子是,如果我想将四个文本框控件放到一个将采用IPv4地址的表单上(每个框表示一个八位字节)。我要做的是创建名为txtIpOctet的
a控件,我有:

Programming is a hobby for me and, as such, I've never been overly motivated to invest a ton of time into transitioning out of VB6 simply because most of the programming I need to do can be done in VB6 (mainly parsing tools). However, I need to make the jump. So I've been trying to do everything in Visual Studio.  Back in VB6 land, I often would create a control and then copy that control, assigning and index value to the control, so that I could enter common code for that control which would then apply to all instances (I'm such a hack I don't even know the technical term for this). An example of this would be if I wanted to plop down four textbox controls onto a form that would take an IPv4 address (each box representing an octet). What I would do is create a control called txtIpOctet and I'd have:

txtIpOctet(0)

txtIpOctet(0)

txtIpOctet(1)

txtIpOctet(1)

txtIpOctet(2)

txtIpOctet(2)

txtIpOctet(3)

txtIpOctet(3)

然后我可以将代码放入该控件(例如作为KeyPress事件中的验证码 - 即,只有数字,第一个八位字节不能是值x,y,z,等等等等。) 似乎这个策略不能在Visual Studio中使用。 如何在Visual Studio中复制此
行为? 谢谢。

Then I could put code into that control (such as validation code in the KeyPress event - ie, only numbers, first octet cannot be value x,y,z, blah blah blah).  It seems that this strategy cannot be used in Visual Studio.  How do I replicate this behavior in Visual Studio?  Thanks.

推荐答案

Hi Peppermint,

Hi Peppermint,

由于此论坛正在讨论并询问有关Visual Basic编程语言,IDE,库,示例和工具(不适用于VB6问题)。

Since this forum is discussing and asking questions about the Visual Basic programming language, IDE, libraries, samples, and tools (Not for VB6 questions).

你的问题与VB6有关。关于vb6的这个链接,请参考:

And your issue is more related to VB6. This link about vb6, please refer that:

http://www.vbforums.com/forumdisplay.php?1-Visual-基本6和早期

谢谢参与论坛活动。

最好的问候,

Cherry


这篇关于有关在Visual Studio 2013中复制VB 6控件行为的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆