Click here to Skip to main content
15,891,253 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Benefits of .Net Pin
Dave Kreskowiak17-Mar-06 2:39
mveDave Kreskowiak17-Mar-06 2:39 
QuestionHow to tacke which object still using the image file? Pin
cylix200016-Mar-06 21:07
cylix200016-Mar-06 21:07 
AnswerRe: How to tacke which object still using the image file? Pin
Dave Kreskowiak17-Mar-06 2:37
mveDave Kreskowiak17-Mar-06 2:37 
Questionalternative for handles button1.click,.................. Pin
mamatharaghu16-Mar-06 18:12
mamatharaghu16-Mar-06 18:12 
AnswerRe: alternative for handles button1.click,.................. Pin
CWIZO16-Mar-06 20:56
CWIZO16-Mar-06 20:56 
Questiongenerating more than one dataset based upon parameter passed Pin
uglyeyes16-Mar-06 16:42
uglyeyes16-Mar-06 16:42 
QuestionIssue updating Listview via Thread Pin
mechman16-Mar-06 13:03
mechman16-Mar-06 13:03 
AnswerRe: Issue updating Listview via Thread Pin
Dave Kreskowiak17-Mar-06 1:47
mveDave Kreskowiak17-Mar-06 1:47 
mechman wrote:
Form1.SetTextLvw(3, "Timer:" & lCnt)


From your Form_Load event, you make a call to Test.TestUpdate(). The problem is that this module doesn't have any refernce to an instance of Form1. Right now, your code won't even compile. Forms do not work like they did in VB6. There is no "global" instance of Form1 that everything can see.

This is a quick and dirty hack, mostly because Modules are an outdated concept, but here's a couple of changes that should get this to work:
Public Module Test
    Public myForm As Form1
    Pricate lCnt As Integer
    Private oTimer As New Timers.Timer(180)
 
    Public Sub TestUpdate()
        If Not myForm Is Nothing Then
            Throw New Exception("You must set the value of myForm before calling TestUpdate!")
        Else
            AddHandler oTimer.Elapsed, AddressOf sTimer
            oTimer.Start()
        End If
    End Sub
 
    Private Sub sTimer(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
        lCnt += 1
        myForm.SetTextLvw(3, "Timer:" & lCnt.ToString())
    End Sub
End Module

Now, when you start your app, you have to tell this module how to get to Form1.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Test.myForm = Me
    Test.TestUpdate()
End Sub



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Issue updating Listview via Thread Pin
mechman17-Mar-06 3:14
mechman17-Mar-06 3:14 
GeneralRe: Issue updating Listview via Thread Pin
mechman17-Mar-06 3:17
mechman17-Mar-06 3:17 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak17-Mar-06 7:25
mveDave Kreskowiak17-Mar-06 7:25 
GeneralRe: Issue updating Listview via Thread Pin
mechman17-Mar-06 7:53
mechman17-Mar-06 7:53 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak17-Mar-06 12:37
mveDave Kreskowiak17-Mar-06 12:37 
GeneralRe: Issue updating Listview via Thread Pin
mechman18-Mar-06 6:04
mechman18-Mar-06 6:04 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak18-Mar-06 6:24
mveDave Kreskowiak18-Mar-06 6:24 
GeneralRe: Issue updating Listview via Thread Pin
mechman19-Mar-06 7:30
mechman19-Mar-06 7:30 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak19-Mar-06 14:22
mveDave Kreskowiak19-Mar-06 14:22 
GeneralRe: Issue updating Listview via Thread Pin
mechman19-Mar-06 14:27
mechman19-Mar-06 14:27 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak19-Mar-06 16:51
mveDave Kreskowiak19-Mar-06 16:51 
GeneralRe: Issue updating Listview via Thread Pin
mechman19-Mar-06 18:05
mechman19-Mar-06 18:05 
GeneralRe: Issue updating Listview via Thread Pin
Dave Kreskowiak20-Mar-06 2:48
mveDave Kreskowiak20-Mar-06 2:48 
QuestionMaking a grid on a MDI form or regular form Pin
Quecumber25616-Mar-06 9:03
Quecumber25616-Mar-06 9:03 
Questionhow can i capture printer's jobs Pin
fahad ahsan16-Mar-06 7:34
fahad ahsan16-Mar-06 7:34 
AnswerRe: how can i capture printer's jobs Pin
progload16-Mar-06 7:56
progload16-Mar-06 7:56 
AnswerRe: how can i capture printer's jobs Pin
Duncan Edwards Jones16-Mar-06 9:30
professionalDuncan Edwards Jones16-Mar-06 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.