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
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
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
Quote:
Originally Posted by RobDog888
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.
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
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
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.
Re: how to make my caprion bar's close button be invisible
Quote:
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.
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.
Re: how to make my caprion bar's close button be invisible
I know....I keep telling them that here. They won't listen.
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
Quote:
Originally Posted by Hack
I know....I keep telling them that here. They won't listen.