c# Custom button error handler

c# Custom button error handler

k4noe_vi
Contributor Contributor
468 Views
0 Replies
Message 1 of 1

c# Custom button error handler

k4noe_vi
Contributor
Contributor

Hey guys been practicing c# in this past few weeks . I tried to make custom button , here is the code

using System;
using System.Windows.Forms;
using ManagedServices;

namespace WindowsFormsApplication20
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            chk();
        }

        private void button1_CUIUpdated(object sender, EventArgs e)
        {
            
        }

      
        private static void chk()
        {
            
            try
            {
                MaxscriptSDK.ExecuteMaxscriptCommand("print \"hello\"");

            }
            catch
            {
                
                MessageBox.Show("Hallo");
                //MessageBox.Show("not valid");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
        }
    }
}

 

 

im stumble upon how to check if this custom dll run in max or not ? if run in max I want do something [like print something] , if not just do nothing. Here is the error code....

 

 

Thanks in advance .

0 Likes
469 Views
0 Replies
Replies (0)