Valhalla Legends Forums Archive | Visual Basic Programming | [VB6] MDI: Controls wont intialize

AuthorMessageTime
laurion
Ok..I do like this
[code]
Dim f as new Form1
f.show
[/code]
So I changed my addtext function to say like f.rtb1 right? Well It gives me 'Object Required.' same with all controls, including winsock..whats the deal? is there like a IntiliazeControls thing lol
September 21, 2005, 2:24 AM
Myndfyr
Is this VB.NET?
September 21, 2005, 4:38 AM
laurion
Oh sorry, Vb6
September 21, 2005, 10:42 AM
rabbit
[code]Load f[/code]
September 21, 2005, 11:10 PM
laurion
[code]
Private Sub mnuAbc_Click()
Dim f As New Form1
f.Show
Load f
End Sub
[/code]
No luck.
September 21, 2005, 11:19 PM
rabbit
Load before .Show
September 21, 2005, 11:35 PM
laurion
i Tried that, no luck =/
rabbit got AIM
September 21, 2005, 11:40 PM
rabbit
Yes, but I'm not on.

This is directly out of one of my MDI projects, and it works:

[quote]    Dim frm As frmController
    Set frm = New frmController
    Load frm[/quote]

Meh.
September 22, 2005, 1:25 AM
laurion
ok so I did
[code]
Private Sub abc_Click()
    Dim f As Form1
    Set f = New Form1
    Load f
    f.Show
End Sub
[/code]

Everything, like my addtext function (which says f.Rtb1 for the rtb) says '424: Object Required'. Rabbit can I email you the src and you can tell me whats wrong :/ I've tried everything at this point  >:(
btw: addtext is in a mod and the pbuffer in a cls
September 23, 2005, 12:21 AM
UserLoser.
Not sure if this'll make a difference, but try:

[code]
Private Sub abc_Click()
    Dim f As Form
    Set f = New Form1
    Load f
    f.Show
End Sub
[/code]
September 23, 2005, 1:17 AM
Myndfyr
[quote author=UserLoser link=topic=12870.msg128997#msg128997 date=1127438235]
Not sure if this'll make a difference, but try:

[code]
Private Sub abc_Click()
    Dim f As Form
    Set f = New Form1
    Load f
    f.Show
End Sub
[/code]
[/quote]

That's exactly what he'd posted.
September 23, 2005, 1:22 AM
UserLoser.
[quote author=MyndFyre link=topic=12870.msg128999#msg128999 date=1127438571]
[quote author=UserLoser link=topic=12870.msg128997#msg128997 date=1127438235]
Not sure if this'll make a difference, but try:

[code]
Private Sub abc_Click()
    Dim f As Form
    Set f = New Form1
    Load f
    f.Show
End Sub
[/code]
[/quote]

That's exactly what he'd posted.
[/quote]

No, it's not
September 23, 2005, 1:26 AM
laurion
Nope.
What I'm going to have to do is move everything into my Form1, like my addtext and pbuffer and stuff =/
September 23, 2005, 1:35 AM
laurion
Ok, I moved everything into my main form and it works fine now.
Thanks for the help!
September 23, 2005, 2:01 AM
Adron
It looks like the original problem was defining f inside a sub and then trying to use it from another sub?
September 26, 2005, 5:29 PM

Search