开发UG NX二次开发 NX12 VB (第三天)

1.按钮对话框 

 

 1 Imports System
 2 Imports NXOpen.uf
 3 
 4 Module NXJournal
 5 Sub Main (ByVal args() As String) 
 6 
 7         Dim UFS As UFSession = UFSession.GetUFSession()
 8         Dim title_string As String = "对话框标题信息"
 9         Dim psMessages() As String = {"对话框内容信息"}
10         Dim Mybutton As UFUi.MessageButtons = Nothing
11         With Mybutton
12             .button1 = True 'True显示按钮 false隐藏
13             .button2 = True
14             .label1 = ""  '按钮的名字
15             .label2 = ""
16             .response1 = 1 '按钮的返回值
17             .response2 = 2
18         End With
19         Dim dialog_type As UiMessageDialogType = UiMessageDialogType.UiMessageWarning
20         Dim response As Integer
21         UFS.Ui.MessageDialog(title_string, dialog_type, psMessages, 1, 0, Mybutton, response)
22 
23         If response = 2 Then
24             MsgBox("2")
25         End If
26 End Sub
27 End Module

 

posted @ 2021-09-30 11:40  KingMAX(没事杀杀毒)  阅读(646)  评论(0)    收藏  举报