【问题标题】:Creating a toggle box dynamically on a window在窗口上动态创建切换框
【发布时间】:2020-06-27 09:03:32
【问题描述】:

我从一个文本文件中获取一个切换框名称,然后在窗口上动态创建一个切换框。 我正在尝试通过此代码执行此操作,但窗口运行成功,但未创建动态切换框。我没有找到我做错的地方?

/* This is in the internal procedure of a window(cb.w)*/

Define variable h as handle.

/*Taking toogle-box name as input*/

Input from check.txt.

    Import unformatted 
    Name_checkbox
Input close.


Create toogle-box h

Assign 
Row = 2

Column = 1

Label = name_checkbox

Visible = true.
     

【问题讨论】:

  • 你是在问如何修复你没有显示的编译错误?

标签: openedge progress-4gl


【解决方案1】:

将 FRAME = FRAME {&FRAME-NAME}:HANDLE 添加到 ASSIGN 块中。

【讨论】:

    【解决方案2】:

    一个不包含导入噪音的完整示例,可以编译(因为工具箱不是小部件,但如果您的示例代表您的实际代码,那么这看起来像您的问题最少)并且可以工作:

    def var hwwindow as handle.
    def var hwframe  as handle.
    def var hwtoggle as handle.
    
    create window hwwindow assign
       width-pixels  = 200
       height-pixels = 200
       status-area   = false
       message-area  = false
       .
    
    create frame hwframe assign
       parent        = hwwindow
       height        = hwwindow:height
       width         = hwwindow:width
       .
       
    create toggle-box hwtoggle assign
       frame         = hwframe
       row           = 1.5
       col           = 3
       label         = "dynamic toggle box"
       visible       = true
       sensitive     = true
       .  
    
    apply "entry" to hwtoggle.
    wait-for close of hwwindow.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-24
      • 2015-11-30
      • 1970-01-01
      • 2013-04-28
      相关资源
      最近更新 更多