-
Sep 6th, 2013, 12:36 AM
#1
Thread Starter
Fanatic Member
Duplicating a Form
I want to create another Form similar to Form1 with controls .. I do not want to use select all , copy and past method for Form2 .. I tried to save Form1 as with different name and tried to add Form as existing , but I get error "Form" will not be loaded . Name is already in use
-
Sep 6th, 2013, 12:41 AM
#2
Hyperactive Member
Re: Duplicating a Form
Does this help?
Code:
Private Sub Command1_Click()
Dim NewForm As New Form1
With NewForm
.Visible = True
End With
End Sub
-
Sep 6th, 2013, 12:43 AM
#3
Thread Starter
Fanatic Member
Re: Duplicating a Form
OK I solved my Problem of duplicating Form ..
May I know
How many Forms and Modules can be added in a vb6 project
How many code lines should be in Form as well as Module
-
Sep 6th, 2013, 03:15 PM
#4
Re: Duplicating a Form
Originally Posted by janu
How many Forms and Modules can be added in a vb6 project
The Project Limitations states that:
Originally Posted by MSDN
A single project can contain up to 32,000 "identifiers" (any nonreserved keyword), which include, but are not limited to, forms, controls, modules, variables, constants, procedures, functions, and objects. Note that the actual number of identifiers is limited to available memory.
Originally Posted by janu
How many code lines should be in Form as well as Module
According to Code Limitations:
Originally Posted by MSDN
The amount of code that can be loaded into a form, class, or standard module is limited to 65,534 lines. A single line of code can consist of up to 1023 bytes. Up to 256 blank spaces can precede the actual text on a single line, and no more than twenty-four line-continuation characters ( _) can be included in a single logical line.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Sep 6th, 2013, 04:26 PM
#5
Re: Duplicating a Form
Janu
In addition to Bonnie's info, an individual Sub or Function can contain
up to around 3,000 lines .. I don't know the exact number, but at least
the IDE gives you a warning .. Too many lines in the Procedure.
However, keep in mind .. there is no warning if you exceed the 65,534 line limit.
If memory serves, when you go to run the app, you'll get the dreaded error message
asking if you want to report the issue to Microsoft. The key point is that all code
that you added since the last time you saved the app will be lost.
Spoo
-
Sep 6th, 2013, 06:54 PM
#6
Re: Duplicating a Form
I remember back several years ago writing a VBA script that exceeded 64k in size. There was no message given but nothing at all happened when the script was run. It had worked correctly just a few minutes before but not at all. I commented out the newly added code and still nothing.
It was a while before I caught the 64k thing and was able to correct the issue by removing a few lines of comments.
I do not know for sure at what level this issue exists in VB6 perhaps a sub or function, perhaps a module or form or class but at some point there is an issue with over 64k bytes of code/comments
-
Sep 6th, 2013, 07:36 PM
#7
Re: Duplicating a Form
Wasn't the 64K limit back when the chip was 8-Bit and could only handle an 8-bit address.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Sep 6th, 2013, 08:14 PM
#8
Re: Duplicating a Form
When I ran into it in my VBA script that was under Windows NT on a Pentium Processor but I think that same thing would have happened on any system.
-
Sep 6th, 2013, 11:54 PM
#9
Thread Starter
Fanatic Member
Re: Duplicating a Form
I duplicated the forms with save as by different names .. when I use commend button to go to another it like blinks before appearing .. is there any way to run it smoothly with any blink or jerk
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
|