Jump to content

(X) button in a VB form


koffer08

Recommended Posts

Hey, So I'm working with forms right now and i lookt everywhere to disable the (X) button or at least get to do a function when its click, i think my best bet would be to have it call a function, I've tried so many options there is on the net but none of them have work't for me, can someone help. thank you in advance

Link to comment
Share on other sites

Err, which (X) button are you referring to?
the default (X) on any popup or form but i already figured it out.
Private Sub UserForm_QueryClose _  (Cancel As Integer, CloseMode As Integer)    If CloseMode = vbFormControlMenu Then        MsgBox "Please use the Close button"        Cancel = True    End IfEnd Sub

thanks anyways.I added it to my Form code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...