Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Cadde
Gallente 221st Century Warfare
|
Posted - 2010.03.22 00:26:00 -
[1]
Originally by: Krathos Morpheus I get an error that says I can not auto-reference the form and should use Me instead, but Me is not allowed inside a module, what am I doing wrong?
Use: Form1.TextBox1.Text
Instead of TextBox1.Text
That is just an example going off the top of my head based on the details you provided.
If anything, chat me up in game and i can give you live help.
My opinions belong to me, you can't have them!
|

Cadde
Gallente 221st Century Warfare
|
Posted - 2010.03.22 00:56:00 -
[2]
I had no problems running this code:
Form1.vb
Public Class Form1
Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Add("Test") ListBox1.Items.Add("Test2") ListBox1.Items.Add("Test3") ListBox1.Items.Add("Test4") ListBox1.Items.Add("Test5") ListBox1.Items.Add("Test6") application.DoEvents Threading.Thread.Sleep(2000) Call updateListApiKeys() End Sub End Class
Module1.vb
Module Module1
Public Sub updateListApiKeys() Form1.ListBox1.Items.Clear End Sub
End Module
However, your situation might be different. Hope this can help you determine whats wrong, otherwise chat me up in game.
My opinions belong to me, you can't have them!
|

Cadde
Gallente 221st Century Warfare
|
Posted - 2010.03.22 00:59:00 -
[3]
Originally by: Krathos Morpheus
As you see I've already done what you suggested. If I put the updatelistapikeys sub on the frmMercader and change frmMercader for Me it works fine. Only thing I can imagine is that maybe the sub is called when loading the form and it breaks because of that.
Try and put this at the beginning of form load.
Me.Show Me.Visible = True Application.DoEvents
And see if it resolves the problem. If it does then you know what happened, as the form wasn't already initialized. Also, try and refrain from running code on the form until it's properly initialized.
My opinions belong to me, you can't have them!
|

Cadde
Gallente 221st Century Warfare
|
Posted - 2010.03.22 01:17:00 -
[4]
Edited by: Cadde on 22/03/2010 01:20:15 Edited by: Cadde on 22/03/2010 01:19:04
Originally by: Krathos Morpheus Edited by: Krathos Morpheus on 22/03/2010 01:14:19
looks like your not online now...
I think the difference could be in that you're triggering the sub with a click, but I do it when visibility changes wich happens while the software is loading. Maybe the error is there.
Update: Looks like it was that, avoiding the tab wich contains the control being focused or visible when loading should do the trick. Thanks for your help.
I am online, i just happened to watch a movie while eating and didn't see the convo request.
EDIT: And btw, glad it works ;)
EDIT 2: And of course i lose connection to eve just now.
My opinions belong to me, you can't have them!
|
|
|