using dispose gives error on PPC and not on PC

Discussion in 'Questions (Windows Mobile)' started by tvrman, Oct 4, 2007.

  1. tvrman

    tvrman Member Licensed User

    Hello,

    I have created in runtime 3 table's , the 3 tables are correct displayed.
    Now i add an panel too, but when i add the panel i want to dispose the table's.
    To create the panel, i will be done during the event of the table, so i mean
    i selected an cell in the table (doesn;t matter which table) then the event will raised to add the panel, the panel will add and then i dispose the table's.
    The problem is on the PPC it generate a runtime error, on the pc not :confused:

    I have read somewhere that during an event to use the dispose i cannot be done of an issue of .net :confused:

    i use this method to dispose

    For TC = 1 To TN
    Control(TC).Dispose
    Next
    TN = 0
    TH = form1.Height - 185



    Another thing in tableevent i have done this code:

    Sub TablesEvent (ColName, Row)

    Control(TN).SelectCell("ID",0)

    If Colname = Control(TN).colname(1) Then

    Option = Control(TN).cell("fullpath",row)

    If option = "Exit" Then
    DirDel("DNWindow", True)
    AppClose
    Else If StrIndexOf(Option , ".",0) = -1 Then



    To Exit my application i choose in table exit (one cell is filled with the word exit), the table event will called but it give an runtime error.


    I have no idea how to solve this.:sign0163:


    the source is very big now to post sorry

    Thanks
     
  2. specci48

    specci48 Well-Known Member Licensed User

    Hi tvrman,

    try to solve your problem using a timer!

    Introduce a timer and set it enabled = false. Enable the timer with the last statement in your event sub. Now code your additional statements within the timer sub. And don't forget to reset it within the timer sub ... ;)

    Code:
    Sub Table1_SelectionChanged(column, row)
        ...
        
    ' do something
        ...
        Timer1.enabled = 
    true
    End Sub

    Sub Timer1_Tick
        Timer1.Enabled = 
    false
        ...
        
    ' do something outside the event...
        ...
    End Sub

    specci48
     
  3. tvrman

    tvrman Member Licensed User


    Hi specci48,

    Yes it works fine now, thanks! :D
     
Loading...