|
-
Jul 21st, 2004, 01:41 AM
#1
Thread Starter
Addicted Member
Opening a new form
Got a problem here.
Dim cf2 As New CrossfireForm2
If (DatePicker1.Value() > Now()) Then
cf2.Show()
End If
Problem is that when cf2 is called, cf1 which is form1 will still be active... How to make cf1 inactive.
Also I tried using .ShowDialog() , error compiling....
-
Jul 21st, 2004, 02:16 AM
#2
Fanatic Member
is this generates error upon compiling?
-
Jul 21st, 2004, 02:21 AM
#3
Thread Starter
Addicted Member
yes, this the error of compliation....
-
Jul 21st, 2004, 02:25 AM
#4
Fanatic Member
i don't get any. what does the error say?
VB Code:
dim f as new form2
f.showdialog() 'woks fine in my [time, lol] machine
-
Jul 21st, 2004, 02:34 AM
#5
Thread Starter
Addicted Member
eh...its says unsupported type of member
-
Jul 21st, 2004, 02:36 AM
#6
Fanatic Member
is your cf2 a form or what? if not, declare it as a form cause no other controls have .showdialog() method [ i think, i'm not sure though ]
-
Jul 21st, 2004, 02:41 AM
#7
Thread Starter
Addicted Member
yeah, cf2 is a form...
Dim cf2 as new Form2
cf2.ShowDialog() ---> this is the error
-
Jul 21st, 2004, 03:15 AM
#8
Addicted Member
I think you can try Overridable in the base class and Overrides in the sub class.........
Or Use .Show()... .
Visible method.....
or .Enable in the If Else loop.....
If not i not so sure......must ask expert lor
-
Jul 21st, 2004, 04:21 AM
#9
Hyperactive Member
When something is too complicate, or I don't know how to use it, normally I try to follow a different path, waiting to be more expert to use it. You can choose this way, making your form1 Hidden before to show Form2, and making Form1 visible, when Form2 is closing. Obviously you must be able to refer Form1 from Form2, if this is a problem, you have to remember to declare Form1 as public in a module. Anyway in this particular case, the situation is not 'We don't know how to Show a form modally', but 'We can't figure why it doesn't work!' , so perhaps there is a little problem to understand and to solve, before it will jump on you later!
Live long and prosper (Mr. Spock)
-
Jul 21st, 2004, 05:03 AM
#10
Where are you calling this code from?
Also, I'd suggest you do all this from a module. Declare form1 and 2 from the module, call 1, and you can then try calling 2 from 1.
-
Jul 21st, 2004, 06:23 AM
#11
Thread Starter
Addicted Member
what do you mean by doing a module?
do you have a simple example ?
-
Jul 21st, 2004, 06:25 AM
#12
Hyperactive Member
But.....the strange thing, I think, is that our friend 'hhh' is able to 'show' form2, but not 'showdialog'. Reference problem, as I wrote, should be when (and IF) he tryes to refer Form1 from Form2, or not?
Anyway to declare (only declare, without instance) forms as public in a module, is generally a very good idea. Last but not least, I could have misunderstood the problem. It happens sometime also on italian forum, but when I use english the probabilities of fail greatly increase!
I hope hhh will post the solution when he will find it. I'm very curious, but not so experienced to give him a real help!
Good luck
Live long and prosper (Mr. Spock)
-
Jul 21st, 2004, 06:28 AM
#13
Thread Starter
Addicted Member
Currently I am in form1...I would like to show form2 from form1 with the help of a button.
So how do i go about doing a simple module for it ?
-
Jul 21st, 2004, 06:48 AM
#14
I know, but I don't know the direct solution either.
In a module:
VB Code:
Dim f1 as New Form1
Dim f2 as New Form2
f1.Show()
'or Application.Start f1
Then, from form1, try
f2.Show()
Good luck.
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
|