表单锁定某些控件 [英] Form Locks Some Controls

查看:66
本文介绍了表单锁定某些控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个form = Options,它是Bound,Modal,PopUp。这个表单包含许多选项卡,每个选项卡都有许多不同的控件。


我有一个带3个选项的Frame,使用单选按钮。工作良好。但是如果选择了选项3(第3个单选按钮),我想启用另一个控件,比如文本框,以获取更多信息。从逻辑上讲,这属于框架,虽然它不是框架的一部分。所以我将文本框显然放在框架中,并使用Format-> Bring-to-Front。它看起来不错,但是......

有时候它有效。有时它可以工作一次。有时它不起作用。每次试验都有不同的结果。不起作用意味着框架内的单选按钮被锁定。无法更改。

删除文本框可以解决问题。将框架更改为矩形将解决问题。当然,将一个帧更改为矩形会失去存储单选按钮状态的能力,并让Access(2000)处理它们。


我想知道如何保留我的帧, 如果可能的话。如果没有,为什么不呢?

解决方案

@OldBirdman


为什么文本框必须位于框架,其功能基本上是提供互斥的选择?恕我直言,没有其他控件属于选项框架,除了你的情况下的其他单选按钮。



为什么文本框必须驻留在框架内



因为它让我感到满意。


如果我允许将一个控件放在另一个上,为什么Access会控制它是否被绑定,或框架,或者问题是什么?我可以,努力,绕过这个。因此,我的问题是,当简单的Access功能应该可用时,为什么我必须编写复杂的代码呢?


恕我直言,除了其他无线电以外没有其他控制属于选项帧您的案例中的按钮



我的选项表单上有一个标签页(名称=图像),其标签标题为图片位置。 3个单选按钮,1 =带程序; 2 =在程序子目录中; 3 =驱动器:\PathName。选择2和3需要路径(或路径片段)。所以我把文本框放在这两个单选按钮的标签下面。选择后,Access会设置框架的值,而I,使用代码,.enable正确的文本框。对我来说,对用户来说似乎很清楚和明显。


  1. 设置框架的Backstyle属性为透明。
  2. 将文本框放置在框架的正下方和外部。
  3. 根据所选的选项,动态增加/重置框架的高度。框架同时使文本框可见/不可见。文本框现在看起来应该在框架中内部。
  4. 代码看起来像这样:

    展开 | 选择 | Wrap | 行号

I have a form=Options, which is Bound, Modal, PopUp. This form consists of many tabs, each with many, varied controls.

I have a Frame with 3 options, using radio buttons. Works fine. But if option 3 (3rd radio button) is chosen, I want to enable another control, say a textbox, to get more information. Logically, this belongs in the Frame, although really not part of the frame. So I place the textbox apparently in the frame, and use Format->Bring-to-Front. It looks good, but...
Sometimes it works. Sometimes it works once. Sometimes it doesn''t work. Different results each trial run. Doesn''t work means that the radio buttons inside the frame become locked. Can''t change.
Removing the textbox fixes the problem. Changing the frame to a rectangle will solve the problem. Of course, changing a frame to rectangle looses the ability to store the status of the radio buttons and have Access (2000) handle them.

I would like to know how to keep my frames, if possible. If not, why not?

解决方案

@OldBirdman
Why is it imperative that the Text Box reside within the Frame, whose functionality is to basically provide mutually exclusive choices? IMHO, no other Controls belong in an Option Frame except other Radio Buttons in your case.


Why is it imperative that the Text Box reside within the Frame

Because it pleases me esthetically.

If I''m allowed to put one control on another, why should Access lock that control if it is bound, or a frame, or whatever the problem is? I can, with effort, get around this. My question therefore is, why should I have to write complicated code when simple Access features should be available?

IMHO, no other Controls belong in an Option Frame except other Radio Buttons in your case

I have, on my options form, a tab page(name=Images) that has a frame with label caption "Picture Location". 3 radio buttons, 1=With Program; 2=In Sub-Directory of Program; 3=Drive:\PathName. Choices 2 and 3 need the path (or path fragment). So I put textboxes under the labels for those 2 radio buttons. When chosen, Access sets the value for the frame, and I, with code, .enable the correct textbox. To me, seems clear and obvious to users.


How about:

  1. Setting the Backstyle Property of the Frame to Transparent.
  2. Place the Text Box immediately below, and outside of, the Frame.
  3. Depending on the Option chosen, dynamically increase/reset the Height of the Frame while making the Text Box Visible/Invisible. The Text Box should now appear to be ''inside'' the Frame.
  4. The code would look something like this:

    Expand|Select|Wrap|Line Numbers


这篇关于表单锁定某些控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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