|
-
Jul 19th, 2004, 03:24 AM
#1
Thread Starter
Addicted Member
Using Inherit button
hi everybody....
I try to create a inherit form from the base form..
I notice that the button that is inherit cannot be use for coding
therefore i try to code the Overrides method in the inherit object and Overridable in the base class for the button.
But i still cannot access the button from the base form to link to the inherit form.
Why !!!! I can only do the link through Show() method inside the button event......
Thanks
-
Jul 19th, 2004, 03:48 AM
#2
I think what you're doing is called visual inheritance. You can use the Shadows keyword to use the button.
-
Jul 19th, 2004, 03:51 AM
#3
-
Jul 21st, 2004, 02:08 AM
#4
Thread Starter
Addicted Member
Hi.....
Thanks....
Do you know that it is still running in the background when you click the button....
any idea how to limit only one form instead of multiple from running in the background....
-
Jul 21st, 2004, 05:06 AM
#5
Not sure what you mean. Try calling it from a module instead.
-
Jul 21st, 2004, 08:40 PM
#6
Thread Starter
Addicted Member
I mean that when you click from form1 to form2
It will link to form2........(As Normal)
but if you click again to form2.........another form2 will pop up
If you try to drag, you will notice there will be one form1 and two form2......
Can this be limit to just one form when the user click the link to form2 twice....
Thanks
-
Jul 21st, 2004, 09:12 PM
#7
Fanatic Member
VB Code:
dim f as new form2()
f.[i]showdialog()[/i]
i don't know if this is what you mean. hope i make sense.
-
Jul 21st, 2004, 09:16 PM
#8
Thread Starter
Addicted Member
No still appear......
I click on the link to another form2 many times....
it create a lot... I have to close the form2 many times
-
Jul 21st, 2004, 09:18 PM
#9
Fanatic Member
VB Code:
' on form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As Form2
For Each f In Me.OwnedForms
If f.Name = "Form2" Then
f.Activate()
Exit Sub
End If
Next
f = New Form2()
Me.AddOwnedForm(f)
f.Show()
End Sub
' on form2
Dim f As Form1
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f = Me.Owner
End Sub
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
|