Click here to Skip to main content
15,908,674 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
these two lines are in one form ..


these two lines

What I have tried:

i try to pass on button click

drawfencec is a function and FrmGoogleMap is the class
the lines fParallelLines1 and fParallelLines2 these lines i want to pass in another form .. these lines draw another two lines on form . as i cannot pass whole code i just paste specific part .. now i want to that how to pass these two line on another through constructor on button click event
Posted
Updated 22-May-16 22:38pm
v4
Comments
OriginalGriff 21-May-16 5:55am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And I can;t work out at all where you are having a problem.
Is there an error message? Where are parallelLines1 and parallelLines2 declared?
What are you trying to do?
What is happening that you didn't expect, or not happening that you did?
Use the "Improve question" widget to edit your question and provide better information.
super_user 21-May-16 6:04am    
updated .. please check
Sergey Alexandrovich Kryukov 21-May-16 10:13am    
Sorry, this is not a question.

Note that "want to that how to pass these two line..." makes no sense; you don't pass lines of code, you pass some objects. During runtime, there are no lines of code. Perhaps this is a figurative expression, but then you need to clarify what you really want to achieve.

—SA

1 solution

Create a constructor for the FrmGoogleMap class which takes two parameters:
VB.NET
Public Class FrmGoogleMap 
    Private fParallelLines1 As List(Of PointLatLng)
    Private fParallelLines2 As List(Of PointLatLng)
    Public Sub New(ByVal pl1 As List(Of PointLatLng), ByVal pl2 As List(Of PointLatLng))
        fParallelLines1 = pl1
        fParallelLines2 = pl2
    End Sub

Then just pass them when you create the instance:
VB.NET
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim f As New FrmGoogleMap(fParallelLines1, fParallelLines2) 
    f.Show
    f.DrawFence()
End Sub
 
Share this answer
 
Comments
super_user 21-May-16 7:03am    
thank a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900