Results 1 to 7 of 7

Thread: Recalling duplicate windows

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    Bay Area, CA
    Posts
    29

    Recalling duplicate windows

    Hey guys - I'm way out of practice here and I just wanted to make a quick little app, but totally forgot how to recall a duplicate window.

    Can somebody give me a head start or a hint on how I go about making an array of forms and bringing up a specific one out of the array when I need? I wish the forms had indexes!

    Thanks a bunch!
    eh?

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Recalling duplicate windows

    What do you mean by duplicate windows?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Recalling duplicate windows

    Here's one way:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim frm() As Form
    5. Dim x As Integer
    6. For x = 0 To 3
    7.   ReDim Preserve frm(x)
    8.   Set frm(x) = New Form2
    9.   frm(x).Left = Form1.Left + (x * 20)
    10.   frm(x).Show
    11. Next x
    12. End Sub

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Recalling duplicate windows

    Forms(index).Show

    I think indices work with that collection.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    Bay Area, CA
    Posts
    29

    Re: Recalling duplicate windows

    Thank you for the help...

    Heres one issue:

    Now that I have the forms created... If one closes, x changes. Example : If I have form1 in an array and I have frm1(1) frm(2) frm(3) frm(4), and I close frm(2), frm(1) remains the same and frm(3) becomes frm(2) and frm(4) becomes frm(3) etc.

    Is there a way to keep the index from changing?
    It makes it very difficult to recall a window if it's index isn't constant.

    Thanks!
    eh?

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Recalling duplicate windows

    You could use the form().tag property to keep track of which is which.
    Or else, you could use the form().caption if it is different.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    Bay Area, CA
    Posts
    29

    Re: Recalling duplicate windows

    Perfect!
    Thanks!
    eh?

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