473,387 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

VB6 : Can I make control box of an MDI form 'Invisible' ? (Cross button)

neo008
85
Hi All,

I want control box of my MDI form Invisible. I dont want user to click on cross button to exit.

I tried Unload events but I dont find it suitable for my project.


Can somebody help? I'm Using VB6

-NE☼
Aug 6 '07 #1
6 5323
hariharanmca
1,977 1GB
Hi All,

I want control box of my MDI form Invisible. I dont want user to click on cross button to exit.

I tried Unload events but I dont find it suitable for my project.


Can somebody help? I'm Using VB6

-NE☼
i think, it is not possible but you can try it in unload event. can you post the method what you had been tryed?
Aug 6 '07 #2
in unload event type

Cancel = 1

that way the user will never get out it unless you send order to exit all program like in command click type

End

also you can use if function with flag to let the user exit with x botom like

'in general
dim flag as integer

'in form load
flag = 1

'in form unload
if flag = 1 then cancel = 1

you can change the flag to any other number from any event you want to let the user press x botom

that's all
Aug 6 '07 #3
Killer42
8,435 Expert 8TB
NE☼ has already worked out how to prevent the user closing the form, with a little help, in another thread. This one is specifically on how to remove the close button from MDI forms.
On a regular form, of course, you can just turn off the ControlBox property. But MDI forms don't have this property.

My guess is it will require an API call.
Aug 6 '07 #4
neo008
85
Correct Killer.

As hariharan asked here is the code i've used. but its not good for me due to other reasons. Moreover I want to make it "Invisible" not disable because it will look ugly in my case.

.


Expand|Select|Wrap|Line Numbers
  1. Private Sub MDIForm_Unload(Cancel As Integer)
  2.     If Picture3.Visible = True Then Cancel = 0 Else End 
  3.  End Sub
And I think it is as same as hassan suggested
Aug 6 '07 #5
Killer42
8,435 Expert 8TB
As hariharan asked here is the code i've used. but its not good for me due to other reasons. Moreover I want to make it "Invisible" not disable because it will look ugly in my case.
That's what I meant. If close function isn't available, the button is usually hidden.

... Else End
Why do you have an END there? That seems rather drastic.
Aug 6 '07 #6
neo008
85
Why do you have an END there? That seems rather drastic.
actually I was assigning an integer value there (in Else condition) as cancel is of integer type.

but I forgot what I had used to allow closing application and vice versa. (because I'm not using it anymore)

though, asked by hariharan I put the code and ....did what u caught.

:D
Aug 7 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: curious | last post by:
I am new to VB.NET and I need help in using timer control. Here is the scenario. I have 3 labels (label 1, label2, label 3), and a start button, all vertically aligned on the form. Using a...
1
by: Deano | last post by:
Hi, I need to disable a command button at some point. Easy enough. Initially in design view it is set as enabled. Now once I disable it, how can I ensure that when the app is restarted, the...
2
by: Gwin | last post by:
I am programming a client service dbase in access 2000 for a non-profit health clinic. I want to create a navigation menu that can show varying numbers of command buttons with varying captions,...
7
by: Gerry Abbott | last post by:
Hi all, Ive got a form with several controls which contain date fields. I'm usng the activex calender control as a separate floating form, I would like to be able to click onto any of the date...
1
by: hmoulding | last post by:
I'm not talking about a bound control. That's something I've already figured out. I have a form that I use to add and update items in a table. Each item can be of one or more types, so there's a...
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
6
by: Selden McCabe | last post by:
I have a form with a bunch of image buttons. When the user moves the mouse over a button, I want to do two things: 1. change the Imagebutton's picture, and 2. make another control visible. I'm...
4
by: Chris Dunaway | last post by:
I have a main form with a "lock" button. When the lock button is clicked, another form is shown using ShowDialog(this). The user must enter their PIN on this form to close it and resume the main...
5
by: Andy B | last post by:
I have 2 TextBoxes and an Add button on a page. When the user fills in the TextBoxes, the values are added to a dataset table. When the page gets done reloading, the TextBoxes are turned into...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.