Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Hide the X on a user form

I wamt to hide the X in the top right corner of a UserForm. Can this be done
and if not how do I disable it?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Hide the X on a user form

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this be done
and if not how do I disable it?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Hide the X on a user form

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this be done
and if not how do I disable it?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Hide the X on a user form

Thanx I'll try it late and let you know how it works out for me...

"Halim" wrote:

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this be done
and if not how do I disable it?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Hide the X on a user form

Something is not working....

"Halim" wrote:

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this be done
and if not how do I disable it?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Hide the X on a user form

I pasted Halim's code into a userform's code module and it worked perfectly.
Did you put the code in the right place (per his second email)?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"David A." wrote in message
...
Something is not working....

"Halim" wrote:

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this
be done
and if not how do I disable it?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Hide the X on a user form

Well,
Ok, What does the user32 stand for? Is that the name of the form?
This is the Form that I'm using.
Where is this would the vb that Halim sent me go?

Private Sub UserForm_Activate()
Application.Wait Now + TimeValue("00:00:03")
Unload Me
Application.ScreenUpdating = False
Sheets("main").Select
Application.ScreenUpdating = True
End Sub


Thanx
David


"Jon Peltier" wrote:

I pasted Halim's code into a userform's code module and it worked perfectly.
Did you put the code in the right place (per his second email)?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"David A." wrote in message
...
Something is not working....

"" wrote:

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can this
be done
and if not how do I disable it?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Hide the X on a user form

Paste his code at the top of the module, right below Option Explicit.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"David A." wrote in message
...
Well,
Ok, What does the user32 stand for? Is that the name of the form?
This is the Form that I'm using.
Where is this would the vb that Halim sent me go?

Private Sub UserForm_Activate()
Application.Wait Now + TimeValue("00:00:03")
Unload Me
Application.ScreenUpdating = False
Sheets("main").Select
Application.ScreenUpdating = True
End Sub


Thanx
David


"Jon Peltier" wrote:

I pasted Halim's code into a userform's code module and it worked
perfectly.
Did you put the code in the right place (per his second email)?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"David A." wrote in message
...
Something is not working....

"" wrote:

just once more...
Place that code into Userform module behind your userform

--
Regards,

Halim



"Halim" wrote:

Hi David,

I hope you aggree with this one, that used API calls to hide X :
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), _
-16, -2067791744
End Sub


--
Regards,

Halim



"David A." wrote:

I wamt to hide the X in the top right corner of a UserForm. Can
this
be done
and if not how do I disable it?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call user form from ThisWorkbook; close file if form closed XP Excel Programming 2 July 20th 07 07:04 PM
Automatically add a textbox to a user form based on user requireme Brite Excel Programming 4 April 7th 07 11:37 PM
User form ComboBox Items: Remember user entries? [email protected] Excel Programming 0 March 29th 07 06:41 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM


All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"