robbin840311 发表于 2008-8-3 22:31:00

[讨论]GetKeyWord设置默认值

<p>代码如下:</p><p>&nbsp; Dim strCal_Yjs As String&nbsp; '判断“已计算”层的值是否也参加计算<br/>&nbsp; Dim strlyrs As String<br/>&nbsp; <br/>&nbsp; With ThisDrawing.Utility<br/>&nbsp;&nbsp;&nbsp; .InitializeUserInput 1, "Yes No"<br/>&nbsp;&nbsp;&nbsp; strCal_Yjs = .GetKeyword(vbCr &amp; "已计算层的值是否加入计算?[是(Y)/否(N)]:")<br/>&nbsp; End With<br/>&nbsp; <br/>&nbsp; Select Case strCal_Yjs<br/>&nbsp;&nbsp;&nbsp; Case "Yes"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strlyrs = """填方标注""" &amp; "," &amp; """挖方标注""" &amp; "," &amp; """已计算"""<br/>&nbsp;&nbsp;&nbsp; Case "No"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strlyrs = "填方标注" &amp; "," &amp; "挖方标注"<br/>&nbsp; End Select</p><p>&nbsp; ThisDrawing.Utility.Prompt vbCr &amp; strlyrs</p><p>我想实现的功能是,当提示用户输入Y或N的时候,默认值设为Y,请问怎么达到这个目的。</p><p>谢谢大家的建议!</p>

robbin840311 发表于 2008-8-4 08:21:00

顶顶

fjfhgdwfn 发表于 2008-8-4 12:53:00

<p>&nbsp;Select Case strCal_Yjs<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "No"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strlyrs = "填方标注" &amp; "," &amp; "挖方标注"</p><p>&nbsp;&nbsp;&nbsp;&nbsp; Case Else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strlyrs = """填方标注""" &amp; "," &amp; """挖方标注""" &amp; "," &amp; """已计算"""<br/><br/>&nbsp; End Select</p><p></p>
页: [1]
查看完整版本: [讨论]GetKeyWord设置默认值