There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
More VB 6 Questions


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
24-Feb-2004, 06:19 PM #1
More VB 6 Questions
How can I make a MDI Parent non-resizable?

And, I need to store my global variables and strings in a module form what I have read. Will this module automatically be loaded at the program start or is there a code I need to load it?

The first one is not that important, but the second is very important
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
24-Feb-2004, 06:51 PM #2
The declarations in a .bas module will be loaded automatically when your program starts. As for making an MDI parent form non-sizeable, give me some time on that one. I have a feeling it can be done but it make take a Win32 API call to do it.
Piringa's Avatar
Senior Member with 468 posts.
 
Join Date: Sep 2002
Location: San Fernando, Ca
24-Feb-2004, 06:55 PM #3
You guys are so geeky n cool, I can't believe I didnt continue my classes at the local college. I did introduction to programming, (pseudocode). I wanna go back but Im so dam lazy. )
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
24-Feb-2004, 07:05 PM #4
Here's one way to keep user from resizing an MDI parent form. The drawback to this method is that it causes a flicker effect in the form which I find distasteful. I'm still looking for an API solution.

If MDIForm1.WindowState <> 1 Then ' allow To Minimize
MDIForm1.WindowState = 0 'Stop Maximize
MDIForm1.Width = 4800 ' Original Size
MDIForm1.Height = 3600 ' Original Size
End If

The numbers for the Width and Height properties above come from the default window size when VB adds an MDI form to an application project. Obviously, if you want to use this method then you will have to change those values to whatever is appropriate for your application.
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
24-Feb-2004, 08:07 PM #5
Quote:
Originally posted by coderitr:
The declarations in a .bas module will be loaded automatically when your program starts. As for making an MDI parent form non-sizeable, give me some time on that one. I have a feeling it can be done but it make take a Win32 API call to do it.
Will it be able to be modified normally, say I declare intNo1 as Integer, will I be albe to make a command do the following:
Private Sub cmdCommand_click()
intNo1 = txtTest.Text
End Sub

And is there aythign I need to modfy in the above code?

Thanks for your help, I will try the MDI code now
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
24-Feb-2004, 09:25 PM #6
Use the keywords Public or Global to prefix your variable declarations in the .bas module and they will be available for read/write to all parts of your application.

I've run into the SetWindowLong( ) API function that can be used to subclass a VB window. It can also (apparently) change the properties of an existing window. Setting the border style of your MDI parent form to a dialog frame may accomplish what you need. Be careful to watch for side effects though.
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
24-Feb-2004, 11:39 PM #7
Ok, I'm having some trouble here, how do I make a text box equal 'Globalvar1' (that is what I named my var and it is declared as a string)?

I'm a little dense with variables, all my pass apps have used text boxes and combinations of them...
AbvAvgUser's Avatar
Distinguished Member with 2,313 posts.
 
Join Date: Oct 2002
Location: Mumbai, India
Experience: Intermediate
25-Feb-2004, 01:40 AM #8
You will have to say textbox.text = Glovalvar1
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
25-Feb-2004, 01:46 AM #9
and how would I make Globalvar1 equal to the textbox? Just gilp it? Would using Const Globalvar1 As String = Text1.Text work?
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
25-Feb-2004, 10:19 AM #10
No. You can't assign a value to a Const that is not set at compile time. AbvAvgUser's post told you how to do this. Just reverse the order if you want to do the assignment the other way.
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
25-Feb-2004, 01:05 PM #11
I was asking if flipping would work as well I don't want to take chances by doing something and messing the whole thing up

Ok, everything is working fine except a little test project with the variables :S

Here is a zip of it
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
25-Feb-2004, 07:19 PM #12
Oh God I feel stupid!!! I just figured out what I was doing wrong ><
AbvAvgUser's Avatar
Distinguished Member with 2,313 posts.
 
Join Date: Oct 2002
Location: Mumbai, India
Experience: Intermediate
26-Feb-2004, 01:35 AM #13
Every problem seems the most difficult untill it is solved. As soon as it gets solved, it seems the most stupid mistake.

Don't worry mate, you are not alone. Everyone who has done programming must have had this feeling.

All the best.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
26-Feb-2004, 04:12 PM #14
I once spent hours debugging a section of code because I'd misspelled a variable name. I've been a software developer for going on a dozen years now and I can tell you that noone is immune from those things.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:34 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.