Results 1 to 9 of 9

Thread: Using Inherit button

  1. #1

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230

    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

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I think what you're doing is called visual inheritance. You can use the Shadows keyword to use the button.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    See if this thread is of any help:

    http://www.vbforums.com/showthread.p...hreadid=288144

  4. #4

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230
    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....

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Not sure what you mean. Try calling it from a module instead.

  6. #6

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230
    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

  7. #7
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    VB Code:
    1. dim f as new form2()
    2. f.[i]showdialog()[/i]
    i don't know if this is what you mean. hope i make sense.

  8. #8

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230
    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

  9. #9
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    VB Code:
    1. ' on form1
    2.    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    3.       Dim f As Form2
    4.       For Each f In Me.OwnedForms
    5.          If f.Name = "Form2" Then
    6.             f.Activate()
    7.             Exit Sub
    8.          End If
    9.       Next
    10.       f = New Form2()
    11.       Me.AddOwnedForm(f)
    12.       f.Show()
    13.    End Sub
    14.  
    15. ' on form2
    16.    Dim f As Form1
    17.    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    18.       f = Me.Owner
    19.    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
  •  



Click Here to Expand Forum to Full Width