Disabling Windows [x] close button

Is it possible to actutally remove the windows [x] (close) button in XM so a users has to close down microstation using a custom button?

 

Thanks

 

John

Parents Reply Children
  • Thanks for the reply. All i want it to do is close down the task navigation bar. I understand there is a variable called MS_Exit where you can specify a user command file... to be run on exit,could this be done here.... I have tried to look up info on how to create one that could do the job for me but there doesn't seem much info on here about.it.... is this possible and how would you create a UCM

    Thanks for any information......  I am really not that good at the programming side of this,.,,

     

     

     

     

  • There does not appear to be events directly tied to opening and closing of Microstation, but there are design file events for load and unload. Below is an example straight out of the help file for VBA for Microstation. (Use the little "?" button in the Object Browser, it's very usefull) Also consider checking the contents. There are some nice overviews there. I'm guessing you could put whatever you want done before close within those events however it does not seem to have a cancel close or anything like VBA forms do. :-(

     

    Here is the excerpt:

    Dim WithEvents hooks As Application

    Private Sub Class_Initialize()
          Set hooks = Application
    End Sub

    Private Sub hooks_OnDesignFileClosed(ByVal DesignFileName As String)
          Debug.Print "Closed design file " & DesignFileName
    End Sub

    Private Sub hooks_OnDesignFileOpened(ByVal DesignFileName As String)
          Debug.Print "Opened design file " & DesignFileName
    End Sub


    "The following code is from a Code Module. It simply creates an instance of the class that has the WithEvents declaration. "


    Dim oOpenClose as clsOpenClose
    Sub SetupHooks()
          Set oOpenClose = New clsOpenClose
    End Sub

     

    I think it mentions you need to put the first part in a class module so you can reference with the second piece of code. But you'd still have to initiate it somehow. Not all that graceful, but it might work.

  • Customising MicroStation

    brookejp:
    All I want it to do is close down the task navigation bar.
    brookejp:
    Is it possible to remove the windows [x] (close) button in XM so a users has to close down MicroStation using a custom button?

    Those are two quite different questions. It would be helpful if you could post a screen shot of what it is exactly that you want to do:

    • What is the task navigation bar?
    • What is the Windows [x] (close) button that you want to remove?

     

    brookejp:
    I understand there is a variable called MS_EXIT where you can specify a user command macro (UCM). I have tried to look up info on how to create one that could do the job for me but there doesn't seem much info on here about it. Is this possible and how would you create a UCM?

    Don't use a UCM: they are obsolete. Prefer Visual Basic for Applications (VBA). Here's some commentary about MicroStation development languages.

    brookejp:
    I am really not that good at the programming side of this.

    We all started from that position!

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions