-
Jun 13th, 2025, 07:06 PM
#41
Thread Starter
Hyperactive Member
Re: [Index was outside the bounds of the array.] But it's not
 Originally Posted by .paul.
Well aware of OOP from my C/C++ days. I just don't see any way other than this to pass that many items through the constructor.
-
Jun 13th, 2025, 07:10 PM
#42
Re: [Index was outside the bounds of the array.] But it's not
 Originally Posted by FunkMonkey
That is not possible... I pass the Main Form OptionsArr through a SetOptionsArr for the DLG.
Well pass your OptionsArr through sub new...
Code:
Public Sub New(OptionsArr(,) as Object)
InitializeComponent
CheckBox1.Checked=OptionsArr 'etc
‘ Etc
End sub
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 13th, 2025, 07:13 PM
#43
Thread Starter
Hyperactive Member
Re: [Index was outside the bounds of the array.] But it's not
 Originally Posted by .paul.
Well pass your OptionsArr through sub new...
Code:
Public Sub New(OptionsArr(,) as Object)
InitializeComponent
CheckBox1.Checked=OptionsArr 'etc
‘ Etc
End sub
I'll give that a shot, thanks!
-
Jun 13th, 2025, 08:50 PM
#44
Re: [Index was outside the bounds of the array.] But it's not
I know what you’ve done now, and you should be making progress now.
We were all barking up the wrong tree for 31 posts because of unnecessary complications. If you’d mentioned the dialog earlier…
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 22nd, 2025, 08:44 PM
#45
Thread Starter
Hyperactive Member
Re: [Index was outside the bounds of the array.] But it's not
 Originally Posted by .paul.
I did warn you that my solution would look nothing like your solution. I'm not sure how you're passing and retrieving data to and from your dialog, but it's incorrect... Have a look here. I can't make it any simpler.
http://www.scproject.biz/Using%20Dialogs.php#bm11
Actually, it looks Identical to what I have.....
Code:
Private Sub BTN_OPTIONS_Click(sender As Object, e As EventArgs) Handles BTN_OPTIONS.Click
Dim oOptions As New DLG_OPTIONS
'Load the arrays for the option dlg
oOptions.SetOptionArray(GetOptionArray)
oOptions.SetSettingsArray(GetSettingsArray)
oOptions.ShowDialog() 'vbModeless
If (oOptions.DialogResult = DialogResult.OK) Then
'Restore our main arrays with any changes made
SetOptionArray(oOptions.GetOptionArray())
SetSettingsArray(oOptions.GetSettingsArray())
End If
End Sub
From the link....
Code:
Private Sub btnCustomDialog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCustomDialog.Click
'declare new frmCustomDialog
Dim frm As New frmCustomDialog
'show the dialog + display the dialog's userText property in a msgbox unless cancelled
If frm.ShowDialog = DialogResult.OK Then
MessageBox.Show(frm.userText)
End If
End Sub
-
Jun 22nd, 2025, 08:45 PM
#46
Thread Starter
Hyperactive Member
Re: [Index was outside the bounds of the array.] But it's not
I have commented out the entire code in the dlg box. The checkbox's do not error at this point. I will backtrack and enable one function at a time till the trouble maker stands out.
Thanks everyone for your input.
-
Jun 23rd, 2025, 12:49 PM
#47
Re: [RESOLVED] [Index was outside the bounds of the array.] But it's not
What seems to be your problem now?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
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
|