Results 1 to 29 of 29

Thread: TAB PAGES!!!! VS keeps rearranging them!

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Angry TAB PAGES!!!! VS keeps rearranging them!

    aah I'm getting crazy!!!! I have 7 tabpages in my tab control. I want to have them in a certain order. No mather what order I choose, VS changes the order at a random time, and to a random order!
    For example I rearrange the tabs, but when I run the program all of the tabpages are in another random order. Sometimes this happens when I switch from code view to design view

    this is the code that VS makes, I edited it manually and put it in the order that I want, but it still keeps changing this line
    VB Code:
    1. Me.tabWizard.Controls.AddRange(New System.Windows.Forms.Control() {Me.tabpSelectPics, _
    2. Me.tabpFormatImages, Me.tabpThumbnails, _
    3. Me.tabpChooseFolders, Me.tabpPages, Me.tabpHtmlTemplate, _
    4. Me.tabpImages})

    any ideas?!!!!
    Last edited by MrPolite; Dec 7th, 2002 at 09:36 PM.
    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!!

  2. #2

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    anyone? going once, going twice? ok, declared unsolvable!


    ok, I'm just gunno commit suicide
    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
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    So lets see if I unserstand


    You have TabControl1 and on this control you have 7 tabs with 7 corresponding tab pages, one per tab?

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by flog3941
    So lets see if I unserstand


    You have TabControl1 and on this control you have 7 tabs with 7 corresponding tab pages, one per tab?
    umm tabpage = tab
    so yeah a tab control with 7 tabs
    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!!

  5. #5
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    have you tried rearanging them in the tab pages collection editor?

  6. #6
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    Did this work?

  7. #7

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by flog3941
    Did this work?
    I've tried that MANY times. aint working. I mean sometimes it works fine. But at some random time it will eventually change the order
    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!!

  8. #8
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    This happened to me once, and I dont know how it resolved. I changed the order manually at design time, ran the program and then reorderd them, but i am not sure this is what resolved the problem. Maybe i am going to face the problem in future again.

  9. #9
    Member
    Join Date
    Nov 2002
    Location
    Austria
    Posts
    52
    i had the same problem... i rearranged the tabs at designtime and since that action the tabs are in correct order. i thought that i had made a mistake but now i read that maybe this could be a bug

    to arrange (add) the tabs at runtime you can do something like that:

    [CODE]
    Me.SuspendLayout()
    Me.TabControl1.TabPages.Clear()
    Me.TabControl1.TabPages.AddRange(New TabPage() {Me.tpBenutzer, _
    Me.tpBerechtigungsprofil, _
    Me.tpFavoriten, _
    Me.tpBenutzerdaten, _
    Me.tpDarstellungsoptionen, _
    Me.tpÄnderungsnachweis})
    Me.ResumeLayout()

  10. #10

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by escape0
    i had the same problem... i rearranged the tabs at designtime and since that action the tabs are in correct order. i thought that i had made a mistake but now i read that maybe this could be a bug

    to arrange (add) the tabs at runtime you can do something like that:

    [CODE]
    Me.SuspendLayout()
    Me.TabControl1.TabPages.Clear()
    Me.TabControl1.TabPages.AddRange(New TabPage() {Me.tpBenutzer, _
    Me.tpBerechtigungsprofil, _
    Me.tpFavoriten, _
    Me.tpBenutzerdaten, _
    Me.tpDarstellungsoptionen, _
    Me.tpÄnderungsnachweis})
    Me.ResumeLayout()
    Glad to see that I wasn;t out of my mind, and someone else had actually this problem.
    But the way you do it, you cant edit the tabs at runtime
    So I guess I have to deal with this, sight
    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!!

  11. #11
    New Member
    Join Date
    Nov 2002
    Location
    Bermuda
    Posts
    5
    Did you ever resolve this. I had the same problem and I think I have worked around it using Add rather than AddRange as follows:

    [CODE]
    Dim intCount As Integer
    Dim myTabPage() As Object

    ReDim myTabPage(2)

    For intCount = 0 To 2
    myTabPage(intCount) = New TabPage()
    TabControl1.TabPages.Add(myTabPage(intCount))
    myTabPage(intCount).Text = "TabPage" & intCount
    Next

  12. #12

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    no never resolved
    the problem is that I'm using the designer to make the tab pages. VS rearranges the elements in the code.
    I've found vs to be very very buggy. It's annoying as hell when you are working on a big project. Memory leaks, crashes, etc.
    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!!

  13. #13
    Addicted Member GSIV's Avatar
    Join Date
    Jun 2002
    Location
    Texas, USA
    Posts
    213
    I've stumbled into this problem too. Anyone have a fix?

  14. #14
    Lively Member
    Join Date
    Jan 2002
    Posts
    105
    I've come across this as well and sadly there dosen't appear to be any way to solve this problem. I think if you use images on the tabs this may be the cause of it because if i just use text VS doesn't re-order them.

    I'm using VS 2002 Pro by the way. Not sure if this has been solved in newer versions.

  15. #15

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Wallabie I'm using VS 2002 Pro by the way. Not sure if this has been solved in newer versions.
    No, many thanks to microsoft, it's still here with us. And hopefully, it will remain with us
    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!!

  16. #16
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    has anyone checked the microsoft knowledge base?

  17. #17
    New Member
    Join Date
    Nov 2003
    Posts
    6
    I am struggling with the same problem.

    Will it still change ig you change the taborder in runtime?

  18. #18
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Originally posted by thephantom
    has anyone checked the microsoft knowledge base?
    I have checked, no definite answer. Some have come to the resoltion similar to what I mentioned earlier in this thread. Reorder the tabs at desgin time in the wrong order that appears at run time. Save, build, run and reorder them again to the order you like, save, build.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  19. #19
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Building on the Add method, which you said you couldn't use because you want to edit the tabpages at run time. You may want to investigate another solution.

    side note: The tabpages in my company's app are actually form classes. And we simply add the forms to the tabcontrol in the correct order, and they stay that way, simply because we add them at run-time. But we use a 3rd party TabControl that can add forms and makes them look like tabpages.. DotNetMagic. You can google for them, its a pretty ok control too. But if you don't want to use it (costs $).......

    Here's a way to add 'forms' to .Net tabcontrols, allowing you to create the tabpages using the Forms designer, and then add them at runtime in the order you wish:

    1) Add a new class item, after the class name, type:
    Inherits System.Windows.Forms.Form

    You should be able to switch to designer mode and layout the 'tabpage' as you wish.

    When you are done laying out the form:

    2) Switch Inherits Windows.Forms.Form to Inherits
    Windows.Forms.TabPage.

    3) You will need to erase the autoscalebasesize line that the designer generated when it was a Form (build it, it will point out the error to you).

    4) You also need to add this to your class:
    VB Code:
    1. Public Sub New()
    2.         MyBase.New()
    3.         InitializeComponent()
    4.  
    5. End Sub

    Now... to test it out.

    You can simply write some code like the following
    under a button click:
    VB Code:
    1. Dim x As New mytabpage()
    2.         x.Text = "1"
    3.         Me.TabControl1.Controls.Add(x)
    4.         Dim r As New mytabpage()
    5.         r.Text = "2"
    6.         Me.TabControl1.Controls.Add(r)

    If you want a reference to the tabpage, you can
    assign different variable names to each page, or
    if that's not required, you can simply keep saying
    VB Code:
    1. x = New MyTabPage
    2. x.Text="1"
    3. Me.TabControl1.Controls.Add(x)
    4. x = New MyTabPage
    5. x.Text="2"
    6. Me.TabControl1.Controls.Add(x)

    In your app, Each tabpageForm class has its own purpose (ascertained by the names you were calling them). You can simply declare variable references at your main Form level, and set them = new mydigitalimagetabpage ... etc.

    This way you can dynamically add the tabpages at runtime in the
    order you wish.
    Last edited by nemaroller; Nov 30th, 2003 at 09:42 AM.

  20. #20
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

    Definitly a bug...

    Hi.

    This is definitly a bug.
    I have experinced this many times.
    No matter how often I rearranged the tabs to the order I wanted
    the IDE kept rearranging them in random order at random times.

    Eventually, I ended up with clearing the tabs in the Form_Load event, and then adding them in the order i wanted.

    Buggy, but effective.

    Hope it helps.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  21. #21
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    I also experienced this. I would create several tabs and in a certain order, only to have the order changed when it was built.

    It did this on the same project on my laptop and desktop so it is definatly a bug in VS. To fix mine, I deleted all tabs, saved, closed and then re-did the tabs on my desktop (deleted them on laptop) and it seemed to fix itself.

    It wouldn't work if I deleted and re-created them on the same PC.

  22. #22
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I'm having the same problem in C# . To me , it seems a bug . I just got used to rearange them again . It's not a big deal anyways .

  23. #23
    Lively Member bmilano's Avatar
    Join Date
    Jan 2005
    Location
    Broad Run, VA
    Posts
    126

    Re: TAB PAGES!!!! VS keeps rearranging them!

    I've struggled with the same problem for about a year, and it has steadily gotten worse even though my tab control only has six pages.

    I gave up the ghost and now solve the issue at runtime. In my form load, I remove all the pages from TabPages in a For/Step/Next loop, and then I add them back in the desired order.

    Since doing that, I have not experienced a reordering problem at runtime. The only downside to this workaround, beyond the 0.0001 seconds of extra runtime this takes on startup, is that while you are working in Visual Studio, the pages are in whatever random order that VB puts them in. That takes a little getting used to, but I don't even really notice it anymore.

  24. #24
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: TAB PAGES!!!! VS keeps rearranging them!

    Wow, this thread is over 2 years old. I was wondering why I had a new reply in it. Heh.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  25. #25
    Lively Member bmilano's Avatar
    Join Date
    Jan 2005
    Location
    Broad Run, VA
    Posts
    126

    Re: TAB PAGES!!!! VS keeps rearranging them!

    Eh...I remember researching this a year ago and finding this thread. I figured that since 99% of the time I'm posting questions, I figured it would be a good idea to go back and post an answer for a change.

  26. #26

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: TAB PAGES!!!! VS keeps rearranging them!

    are you using VS2005? wondering if this is fixed in the new VS
    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!!

  27. #27
    Lively Member bmilano's Avatar
    Join Date
    Jan 2005
    Location
    Broad Run, VA
    Posts
    126

    Re: TAB PAGES!!!! VS keeps rearranging them!

    Don't know...haven't gone to 2005 yet. Sorry.

    Check with me again, oh...in about two years.

  28. #28
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Re: TAB PAGES!!!! VS keeps rearranging them!

    i had the same problem in 2003 however i have a couple of tabcontrols in the new IDE and i haven't had the problem since

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

  29. #29
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I hate digging in old threads but since you guys started then it'd hurt more if I add this :
    The problem in TabControls in VS.NET 2002/2003 was because of the IDE and scripting the code behind . Rearranging tabpages could've been fixed by rewriting the code that adds the tabpage to the tabcontrol in the same order you want...This is how I managed it and ever since it's ok . In 2005 , I worked heavily on tabcontrol and I can tell it's working good so far , no problems....Now stop this and let this thread float down out of the first page in the forum

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