将字符串转换为Form对象 [英] Convert string to a Form object

查看:65
本文介绍了将字符串转换为Form对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我发现了一些关于这个主题的资料,但它都是关于vb6的。

我有一个表格,其中包含我系统中表格的名称。从表格中获取表单名称后,我想设置AllowEdits和AllowEdits。该表单的属性为false,但为此我需要将包含表单名称的字符串转换为Form对象,至少我认为..这是我的代码片段:

Hi,
I found some material about this topic but it all refered to vb6.
I have a table which contains names of the forms in my system. After getting the form name out of the table, i want to set the "AllowEdits" property of that form to false, but for that i need to convert the string which contains the form name into a Form object, at least so i think.. here is a piece of my code:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号

推荐答案

您是否将strFormName视为表单类型而不是字符串?


赞:
Are you delcaring strFormName as a form type, not a string?

Like:
展开 | 选择 | 换行 | 行号


@Megalog


Hi Megalog,

我实际上将其声明为字符串。这样我就可以为它指定表单名称,但是不能指定表单属性(例如AllowEdits)。如果我将其声明为Form,那么我可以分配属性但没有名称..
@Megalog
Hi Megalog,
I actually declared it as string. That way i can assign it the form name, but can''t assign form property (such as AllowEdits). And if i declare it as Form, than i can assign the property but don''t have the name..


有可用的集合,允许您传递字符串参数以选择匹配项。
There are collections available that allow you to pass a string parameter to select the matching item.
展开 | 选择 | Wrap | 行号


这篇关于将字符串转换为Form对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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