Thanks for the feedback Dave. However, my application is a little bit different. In the main program, I am using streamreader to read in a text file line by line. Each line is a file path to a jpeg picture. In my loop of reading the file, I dont want the streamreader to read the next line until the user presses the button. Somehow I think I need to monitor if the button has been clicked or not within the streamreader loop. Maybe there's an easier way, I dunno..... -Mike
mpiotro
Posts
-
putting an event procedure subroutine into a different event procedure -
putting an event procedure subroutine into a different event procedureIn .net, I am reading in a text file, line by line. Each line represents the file path for a picture I'd like to show. What I am trying to do is change the picture each time a user clicks the button. For example, lets say I've got something like this: Private Sub Form2_Load If Button1.Click = 1 Then PictureBox1.Visible = True PictureBox1.Image = System.Drawing.Image.FromFile _ (string1(y)) End If I know I can't do button1.click like this, but is there another way? Basically, I want the if condition to check if the button has been clicked or not. Thanks for any help or direction, Mike
-
passing variables between windows formsPablo, Sorry, I should have clarified. Yes, I am attempting this in vb.net. I am just starting in programming in .net, with no experience in vb6. I did try declaring as Public, but with no luck. I'm sure there's a way of declaring variables globally so that this is possible. By the way, I'm not sure what a .bas module object is. Is this vb6 terminology. Thanks again for your help, Mike
-
passing variables between windows formsHow can I do this? For example: let's say on form1.vb, i have the following code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click product_code = TextBox1.Text.Substring(0, 4) 'switch over to next window Dim form2 As New form2 form2.Show() Endsub Now, how can I get the value in product_code in Form2.vb ?