|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
Dim intCommands As Integer Dim strCMD() Dim strForm() Private Sub Form_Load() List1.Clear intCommands = 0 End Sub Private Sub Form_Terminate() frm__START = Nothing End Sub Public Sub Add_Items(strItem As String, strFromName As String) 'On Error Resume Next ReDim Preserve strCMD(intCommands) ReDim Preserve strForm(intCommands) strCMD(intCommands) = strItem strForm(intCommands) = strFromName Me.List1.AddItem strItem, intCommands Вот здесь созникает ошибка, когда форма загружается второй раз: Invalid procedure call or argument "5" intCommands = intCommands + 1 End Sub Когда нажимаю F8 то все нормально проходит, стоит поставить OnError Resume NEXT, то вообще не грузятся данные в List1 (это стандартный LISTBOX) Помогите, как быть? p/s Походу какая-то несостыковка с index ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 11:26 |
|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
А вот так :Me.List1.AddItem strItem ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 12:23 |
|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
Вдогонку, невнимательно посмотрел код. Здесь еще может быть вот что. Load происходит при загрузке, и если вы делаете hide а не unload то при повторной загрузке load не происходит а происходит Acticate. Так вот в него и перекиньте код из Load. ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 12:29 |
|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
Эта форма называется frm__START Private Sub Form_Terminate() set frm__START = Nothing End Sub Так все равно, ошибка таже самая :((( Блин, работаю с более сложными гридами и контролами и все нормально! А с простым (ListBox) не могу справиться ! ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 15:35 |
|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
Спасибо! Решил проблему поставив вместо события Form_Terminate Form_Unload (потому как первое не всегда запускается) ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 15:43 |
|
ListBox - проблемы
|
|||
---|---|---|---|
#18+
Вот что говорит MSDN Terminate Event Occurs when all references to an instance of a Form, MDIForm, User control, Property Page, Webclass, DHTML Page Designer, or class are removed from memory by setting all the variables that refer to the object to Nothing or when the last reference to the object falls out ofscope. Syntax Private Sub object_Terminate( ) The object placeholder represents anobject expression that evaluates to an object in the Applies To list. Remarks For all objects except classes, the Terminate event occurs after the Unload event. The Terminate event isn't triggered if the instances of the form or class were removed from memory because the application terminated abnormally. For example, if your application invokes the End statement before removing all existing instances of the class or form from memory, the Terminate event isn't triggered for that class or form. Так что логично. :) ... |
|||
:
Нравится:
Не нравится:
|
|||
10.09.2003, 15:56 |
|
|
start [/forum/topic.php?fid=60&gotonew=1&tid=2170798]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
31ms |
get topic data: |
12ms |
get first new msg: |
8ms |
get forum data: |
3ms |
get page messages: |
47ms |
get tp. blocked users: |
2ms |
others: | 269ms |
total: | 402ms |
0 / 0 |