RSS Forums RSS
Please support our VB.NET advertiser: Programming Forums
Views: 232 | Replies: 2 | Solved
Reply
Join Date: Oct 2005
Posts: 11
Reputation: kdw3 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
kdw3 kdw3 is offline Offline
Newbie Poster

Using Public arrays with a dialogue box

  #1  
Jul 8th, 2008
Hi,

I am trying to use a 2D array to gather information from a dialogue box. The array has been publicly dimensioned in a module. Before the dialogue box is opened, there is data in the array, and thats fine, but as soon as soon as the dialogue box is loaded, the contents of the array become "Nothing". The dialogue box is a seperate form that is loaded using the form2.showdialogue command.

If anybody knows why this is happening or how to fix it, any help would be greatly appreciated.

Thanks in advance.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2002
Location: West Virginia
Posts: 412
Reputation: waynespangler is on a distinguished road 
Rep Power: 6
Solved Threads: 45
waynespangler waynespangler is offline Offline
Posting Pro in Training

Re: Using Public arrays with a dialogue box

  #2  
Jul 8th, 2008
Show us the code you are using to load the array.
Wayne

It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
Reply With Quote  
Join Date: Oct 2005
Posts: 11
Reputation: kdw3 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
kdw3 kdw3 is offline Offline
Newbie Poster

Re: Using Public arrays with a dialogue box

  #3  
Jul 8th, 2008
Hi,
Thanks for the reply but I actually managed to sort it out a few minutes before you replied. I managed to do it by declaring an object, putting the data from the array into the object and then using the following code

Dim objArray As Object
objArray = array

Dim CreateHeader As New frmCreateHeader(objArray)
'Where frmCreateheader is the form being used as the dialogue box

CreateHeader.ShowDialog()

and then on the other form, I had the following code

Public Sub New(ByVal arraydata As Object)

'Dim arraytmp(,) As String
arraytmp = arraydata 'Where arraytmp is glob var defined in a mod.

' This call is required by the Windows Form Designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call.

End Sub

There might be a better way to do it, and if you know please let me know, but that seems to be the most efficient method i have come across

Regards,
Kevin
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:54 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC