Hallo
habe mir auch SharpDevelop geladen und es gebastelt hat prima funktioniert.
Jetzt möchte ich aber mit einen Button ein Macro aufrufen.
Das Macro an sich funktioniert
Das Macro von einen anderen Journal aus funktioniert
Nur der Aufruf mit einen Button Funktioniert nicht
Kann es daran liegen das das Auswahlmenü noch sichtbar ist ???
hier mein Code:
-----------------------------------------------
' Menü zum importieren div. Tabellen
' Stefan Schneider 18.12.08
' -----------------------------------------------
Imports System
Imports System.Console
Imports System.Drawing
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Imports NXOpen
Module NXJournal
Declare Sub MACRO_playback_from_usertool Lib "libugui" Alias "?MACRO_playback_from_usertool@@YAXPAD@Z" (ByVal lpName As String)
' -----------------------------------------------
' Hier startet das Programm
' -----------------------------------------------
Class App
Shared Sub Main ()
' Neues Formular anlegen
Dim oF As New frmHaupt()
' Neues Formular anzeigen
Application.Run (oF)
End Sub
End Class
' -----------------------------------------------
' definieren des Menüs
' -----------------------------------------------
Public Class frmHaupt
Inherits System.Windows.Forms.Form
Friend WithEvents button1 As System.Windows.Forms.Button
Friend WithEvents button2 As System.Windows.Forms.Button
' -----------------------------------------------
' Anlegen des Menüs
' -----------------------------------------------
Sub New()
MyBase.New()
Me.button1 = New System.Windows.Forms.Button
Me.button2 = New System.Windows.Forms.Button
Me.SuspendLayout
'Änderungstabelle
Me.button1.Location = New System.Drawing.Point(20, 37)
Me.button1.Name = "button1"
Me.button1.Size = New System.Drawing.Size(110, 23)
Me.button1.TabIndex = 0
Me.button1.Text = "Änderungstabelle"
'Pfeil gedreht
Me.button2.Location = New System.Drawing.Point(20, 90)
Me.button2.Name = "button2"
Me.button2.Size = New System.Drawing.Size(110, 23)
Me.button2.TabIndex = 0
Me.button2.Text = "Pfeil gedreht"
'Form
Me.ClientSize = New System.Drawing.Size(150, 150)
Me.Controls.Add(Me.button1)
Me.Controls.Add(Me.button2)
Me.Name = "MainForm"
Me.Text = "Auswahlmenü"
End Sub
' -----------------------------------------------
' Die Click-Ergebnisse des Buttons
' -----------------------------------------------
Private Sub ClickEreignis(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Msgbox ("Test!")
MACRO_playback_from_usertool("test.macro")
End Sub
End Class
End Module
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP