ctrl01 发表于 2006-3-23 13:47:13

请各位帮忙看看。关于dialog问题。

我要得到的结果是,从下拉选择中选择哪一种,就相应的执行哪个脚本。
具休如下:

Dim cchoices as String
   Dim answer as string
   cchoices="第一种"+Chr$(9)+"第二种"
    Begin Dialog UserDialog 180, 95, "选择对话框"
       ButtonGroup .ButtonGroup1
       Text9, 3, 69, 13, "请选择:", .Text1
       ComboBox9, 17, 111, 41, cchoices, .ComboBox1
       OKButton131, 8, 42, 13
       CancelButton131, 27, 42, 13
       PushButton 132, 48, 42, 13, "Help", .Push1
    End Dialog
   Dim mydialogbox As UserDialog
   answer=mydialogbox.combobox1‘-------------是不是这样写是错的??????
   Select Case answer
      Case "第一种"
         MsgBox "你选择的是"&str(answer)
      Case "第二种"
         MsgBox "你选择的是"&str(answer)

   End Select

请各位前辈指教。。并帮忙修改下。。谢谢!!!

qjwxsd 发表于 2006-3-23 17:55:04

要先取得ComboBox 的Text 属性值

利用sqaGetProperty("Name=comboBox1","Text",sAnswer)来获取选中的文本值.
再做判断.

ctrl01 发表于 2006-3-24 08:27:06

再请教,

己按您的方法,可以点击“OK”后,没法读到该选择框的值啊。
Result=sqaGetProperty("Name=comboBox1","Text",Answer)

烦再指点指点。。。

qjwxsd 发表于 2006-3-24 10:36:15

再填入一些属性值

Name,ObjectIndex,Type,VisualText 等等.
就能找到了.

iov_cp 发表于 2006-12-19 15:57:47

Answer N years later

如果你有SQABasicRef.pdf的话,请参考begindlg的内容,它是通过dialog调用与之有关的function返回你需要的值
Begin Dialog dialogName dx, dy [, caption$]
[, .dialogfunction ]
... ' dialog box definition statements
End Dialog

Syntax Element Description
dialogName The record name for the dialog box definition.
x, y The coordinates for the upper left corner of the dialog box.
dx, dy The width and height of the dialog box (relative to x and y).
caption$ The title for the dialog box.
.dialogfunction A function to process user actions in the dialog box.

The optional .dialogfunction function must be defined (using the Function
statement) or declared (using Dim) before being used in the Begin Dialog
statement. Define the dialogfunction with the following three arguments:
Function dialogfunction% (id$, action%, suppvalue&)
... 'function body
End Function
页: [1]
查看完整版本: 请各位帮忙看看。关于dialog问题。