Results 1 to 3 of 3

Thread: question about control order

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Posts
    18

    question about control order

    I have put 4 labels in one column and I want them to be sorted in a specific way:
    *if one of them is temporaly invisible (labelX.visible=false) it makes all other, visible labels below, move one place forward to the top and keeps the same column order.


    LABELS:
    Label1
    Label2
    Label3
    Label4


    IF LABEL2.VISIBLE = FALSE: labels should be sorted like this
    Label1
    Label3
    Label4

    So I have written this code:

    For Each tabPageCtrl In Me.TabControl1.Controls
    For Each ctrl In tabPageCtrl.Controls
    If TypeOf ctrl Is Label Then
    If ctrl.Visible = True Then
    ctrl.Top = visina
    visina = visina + ctrl.Height
    End If
    End If
    Next
    Next

    The problem is that VB compile label with the lowest identification number (in my case: label1) at the end and all other labels before.

    So the VB compiling goes like this:

    Label2
    Label3
    Label4
    Label1 'at the end'

    and that makes my sort program disfunctional.

    Thank you for help

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    have you tried the bringtofront and sendtoback functions? (I thinks that's what they're called )
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Posts
    18
    ahhh..... now when i've send to back every label from top to bottom it works ok...
    what a weird thing...

    anyway thank you for your help
    it is nice to be important but is more important to be nice

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