|
-
Aug 10th, 2007, 04:28 AM
#1
Thread Starter
Addicted Member
how to make my caprion bar's close button be invisible
Hi all,
this thread is regarding to v.b 6.0. we know that the caption bar of every form also contains three buttons.those are minimize, close, and restore. now i want to remove those things. snce, as my v.b application is having close button( i already set the forms boarder style as 1:fixed single),my user is trying to close the application. but my user should not do like that...
what can i do to achieve this... if u know that kindly let me know this...
Thanks:
regards:
raghunadhs
-
Aug 10th, 2007, 04:30 AM
#2
Re: how to make my caprion bar's close button be invisible
Disabling the 'x' close button can be done like so...
http://www.vbforums.com/showpost.php...71&postcount=2
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2007, 05:58 AM
#3
Thread Starter
Addicted Member
Re: how to make my caprion bar's close button be invisible
Great Rob.... it is working.thank you.. still i have 2 questions..
Q1: can't i make the x button invisible?
Q2: can you say what event will be occured suppose if user pressed X button (asume i did not write those 2 APIs,what u used in your example)? why i am asking is, suppose if any one of hte form termination or, unloading event will be invoked, why don't i write as "Load form1" in those events...?
if the question is not clear pls let me know this....
Thanks:
regards:
raghunadhs.v
 Originally Posted by RobDog888
Last edited by raghunadhs; Aug 10th, 2007 at 06:15 AM.
Reason: to make it more clarity
-
Aug 10th, 2007, 06:23 AM
#4
Re: how to make my caprion bar's close button be invisible
You may be able to remove the 'x' button only but I dont know what the style constant is for it.
No events will be invoked if the user clicks on the 'x' with my code.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2007, 07:34 AM
#5
Re: how to make my caprion bar's close button be invisible
There are 5 ways to check how a form is being closed. Each of them can be coded for.
vb Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'there are 5 unloadmode levels
Select Case UnloadMode
Case vbFormControlMenu 'UnloadMode 0
'form is being unloaded via the Close
'or by hitting the X in the upper right hand corner
'command from the System menu
Case vbFormCode 'UnloadMode 1
'Unload Me has been issued from code
Case vbAppWindows 'UnloadMode 2
'Windows itself is closing
Case vbAppTaskManager 'UnloadMode 3
'the Task Manager is closing the app
Case vbFormMDIForm 'UnloadMod 4
'an MDI child form is closing because
'its parent form is closing
End Select
End Sub
-
Aug 10th, 2007, 08:06 AM
#6
Thread Starter
Addicted Member
Re: how to make my caprion bar's close button be invisible
Thanks Hack,
thrugh your reply, i came to know how the form will be closed. now i will check, if any one of the levels what u have mentioned will be helpful to achieve my objective or not, and let you know the feed back.
Thanks for your immediate responce.
Hi Rob: what u said is right, i removed the X button and checked the form, it is not proper, and stylish also....Thanks for your suggestion....
regards:
raghunadhs
[QUOTE=Hack]There are 5 ways to check how a form is being closed. Each of them can be coded for.[highlight=vb]Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'there are 5 unloadmode levels
Select Case UnloadMode
-
Aug 10th, 2007, 08:19 AM
#7
Re: how to make my caprion bar's close button be invisible
No, when you have a min and max button it is the Standard in Windows to keep the 'x' close box and if you want to disable it or not is up to you but to try to remove just the one is not proper. 
Haveing the 'x' close button disabled is also proper standards in Windows.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2007, 08:28 AM
#8
Re: how to make my caprion bar's close button be invisible
 Originally Posted by RobDog888
Haveing the 'x' close button disabled is also proper standards in Windows.
Maybe, but it violates development standards where I am. For reasons known only to the people that created the standards, the X ALWAYS has to be available.
This is not the first place that I've been where this is the case either.
-
Aug 10th, 2007, 09:47 AM
#9
Re: how to make my caprion bar's close button be invisible
Well I just am commenting off of what is visible in Windows as its their standard for windows. Now if you have a workplace that has their own and it coincides with some other one then that still is a non-windows standard.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2007, 09:51 AM
#10
Re: how to make my caprion bar's close button be invisible
I know....I keep telling them that here. They won't listen.
-
Aug 11th, 2007, 02:39 AM
#11
Thread Starter
Addicted Member
Re: how to make my caprion bar's close button be invisible
HI Hack & Rob,
Actually, i am a fresher to industry and don't know the standards..etc. why i want to make the X button invisible is...
My V.b application contains number of frames on a single form. every time one frame will be in visibility, remaining will be in invisible, if user clicks a command button on frame1, then frame2 will be appeared, frame 2 contains a "Back" Button. if user presses that "back" button again, frame1 will be appeared. my application is regarding to establishing a communication between 2 pc s via "winsock". so if user clicks X button by mistakenly to close the second frame(since he may not be aware of the app), entire communication will be lapsed.
So at that time i thought that it was better to make my X button invisible. As per the knowledge, what u shared in previoius posts, i did that also , but it is not attractive.
Now my question is Could you please suggest me a better way so that user should not be confused and he should not be able to close the app? (in my GUI i provided every thing like exit button, back button like that, but some people are cliking the X button)
Thanks & regards:
raghunadhs
 Originally Posted by Hack
I know....I keep telling them that here. They won't listen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|