Design time vs. Run time 
Author Message
 Design time vs. Run time

Hello,

At design time it's easy to create for instance a Line object; just drag.
Now I want to create a unknown number of Lines at run-time.
I tried the following lines of code to create one Line instance:

    Dim line1 As Line
    Set line1 = New Line

The problem is that the compiler produces an error after the 'New'-operator.
I thought this could mean two things:
1.    The Line class is PublicNotCreatable, but then not one of the standard
ActiveX controls should bePublicNotCreatable, because I tried to instantiate
some of them at run-time.



Mon, 31 Mar 2003 03:00:00 GMT  
 Design time vs. Run time


Fri, 19 Jun 1992 00:00:00 GMT  
 Design time vs. Run time
Hello,

At design time it's easy to create for instance a Line object; just drag.
Now I want to create a unknown number of Lines at run-time.
I tried the following lines of code to create one Line instance:

    Dim line1 As Line            'Line is known
    Set line1 = New Line       'Line is unknown

The problem is that the compiler produces an error after the 'New'-operator.
I thought this could mean two things:
1.    The Line class is PublicNotCreatable, but then none of the standard
        ActiveX controls should bePublicNotCreatable, because I tried to
instantiate
        some of them at run-time. They all Failed this way.

2.    The correct component Library should be included, but then I really
don't know which library / libraries to
        include.

What should I do?



Mon, 31 Mar 2003 03:00:00 GMT  
 Design time vs. Run time


Fri, 19 Jun 1992 00:00:00 GMT  
 Design time vs. Run time

Quote:
>At design time it's easy to create for instance a Line object; just drag.
>Now I want to create a unknown number of Lines at run-time.

There are two ways to dynamicly create controls in VB6. The first is
to use control arrays and the Load statement. The second is to use
Controls.Add.

Matt

============================================

  CodeHound - Free VB Search Engine
  http://www.codehound.com



Mon, 31 Mar 2003 03:00:00 GMT  
 Design time vs. Run time


Fri, 19 Jun 1992 00:00:00 GMT  
 Design time vs. Run time
Use the line method for the container object instead. You can draw lines at
runtime in usercontrols, pictureboxes, and forms. Just add the code in the
paint event for the object. Look in help for the syntax. You can even create
filled boxes.
This will not however, draw over controls. You can draw over controls but it
is a pain.
Example:

Private Sub UserControl_Paint()
    'Draws diagonal line on usercontrol
     UserControl.Line (0, 0)-(ScaleWidth, scaleheight)
End Sub

Good Luck,

--
Sergio DeAlbuquerque
President

Matrix Technical Services Inc.
172 N.Bicycle Path
Selden, NY 11784

Ph: 631-736-9001
Fax: 631-696-8538

http://www.matrixengg.com

"CAD services, machine design, VB and VBA application development"



Mon, 31 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. web service and updating web reference with vb.net design time vs run time

2. web service and updating web reference with vb.net design time vs run time

3. Design time vs Run time

4. Run Time vs Design Time - No Current Record

5. Design Time vs Run Time

6. Assign a treeview at design run time to other at design time

7. Code running in design time or run-time?

8. ADO data control Design -vs- Run Time

9. Paint Event different design vs run-time?

10. getting run-time behavior of a contained control in a user control at design time

11. MsgBox pauses App at Design time but not run time

12. design-time functionality at run-time

 

 
Powered by phpBB® Forum Software