以子格式创建的文本框控件不能通过鼠标选择

时间:2016-09-02 07:04:59

标签: c# .net winforms

我的项目中有以下情况。

类'UserForm'派生自Windows.Form类,它上面有一个TextBox控件。创建并显示类“UserForm”(userForm1)的实例。创建了“UserForm”的另一个实例(userForm2),并将其父级设置为userForm1并显示。

我可以使用鼠标在userForm1的文本框控件中选择文本。但是userForm2上的TextBox控件不允许使用鼠标选择文本,也不能使用鼠标设置光标。只需双击控件即可选择文本。请注意,我可以使用键盘选择文本。

range27 = range

def range26(start=None, stop=None, step=None):
    if start is not None and not isinstance(start, int):
        start = int(start)
    if stop is not None and not isinstance(stop, int):
        stop = int(stop)
    if step is not None and not isinstance(step, int):
        step = int(step)
    return range27(start, stop, step)

def execute_user_code(user_file):
    ...
    src = read(user_file)
    global_dict = {}
    local_dict = {}
    ...

    if check_magic_version_comment(src) in (None, '2.6'):
        global_dict['range'] = range26
        global_dict['range27'] = range27
        # the last line is needed because the call
        # of range27 will be resolved against global_dict
        # when the user code is executed

    eval_code(src, global_dict, local_dict)
    ...

0 个答案:

没有答案