![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
I don't see this problem I'm afraid. What error occurs when you use the qualified form of Control()?
ctrl = "tab" Control("ctrl).Dispose 'Gets compiled buts throws a runtime Invalid Cast error ctrl = "tab" Control(ctrl, TabControl).Dispose 'Works fine at runtime Quote:
|
|
||||
|
Are you using the most updated ControlsEx.dll?
ControlsEx update |
|
||||
|
I am using ControlsEX.dll version 1.0.2995.34468, created 10 March 2008 at 7:52 AM.
This is the actual code I'm using: Code:
Sub formGeneric_Close c = arrayListGenericControls.Count For x = ( c - 1 ) To 0 Step -1 cn = arrayListGenericControls.Item( x ) If StrIndexOf( ControlType( cn ), "TabControl", 0 ) <> -1 Then Control( cn, TabControl ).Dispose Else Control( cn ).Dispose End If arrayListGenericControls.RemoveAt( x ) Next End Sub ![]()
__________________
PC: Windows XP Pro SP3 / Basic4PPC v6.5 PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6 Last edited by willisgt : 03-21-2008 at 02:28 PM. |
|
||||
|
I slightly simplified your code for testing and it works for me. Perhaps you have something else wrong - like a case-difference with the names in the ArrayList.
Code:
Sub Form2_Close cn = "tab" ' tab is the name of the TabControl If StrIndexOf( ControlType( cn ), "TabControl", 0 ) <> -1 Then Control( cn, TabControl ).Dispose Else Control( cn ).Dispose End If End Sub |
|
||||
|
Andy, you get full credit for this fix...
Apparently, your suggestion of checking both type 'TabControl' and 'TabControl.TabControl' had actually fixed the problem. Thing is, I also have a scrollbar on this form. So when I tried to dispose of the scrollbar, I was producing yet another cast exception error - identical, but from a different source. My apologies for the oversight - I should have realized that both TabControl and ScrollBar types would do this. ![]()
__________________
PC: Windows XP Pro SP3 / Basic4PPC v6.5 PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| add progressbar in to tabControl | thaidelphi | Questions & Help Needed | 1 | 09-05-2008 05:55 PM |
| VGA + TabControl | Elrick | Questions & Help Needed | 10 | 04-16-2008 02:25 PM |
| using dispose gives error on PPC and not on PC | tvrman | Questions & Help Needed | 2 | 10-05-2007 07:32 PM |
| ArrayList won't dispose? | willisgt | Questions & Help Needed | 1 | 08-30-2007 08:56 PM |
| ArrayList Dispose Method | RandomCoder | Bug Reports | 2 | 07-02-2007 01:57 PM |