Solved

Continued combobox issue - integer entered into second form following combobox selection

Posted on 2013-01-29
3
240 Views
Last Modified: 2013-01-30
Hi-  Through much help, I received the following code.  


------------------------------------------------------
Public Class Form1

    Private WithEvents ObjForm As Form

    Dim Form2 As New Form2
------------------------------------------
Private Sub TypeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TypeComboBox.SelectedIndexChanged

        Dim Int As Integer

        If TypeComboBox.SelectedItem = "NonProv" Then
            Int = 360

            If ObjForm Is Nothing Then ObjForm = New Form2(Int)

        End If

    End Sub
------------------------------------

    Private Sub Alarm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Alarm_btn.Click
        'the below connects the first form with the second form.  

        Form2.Show()

    End Sub
-----------------------------------
This did not present any problems, however now I am unable to access the second form from via the button click event.  I've tried many variations, but still no success.  Any advice?  Also, and more to the point, what am I not understanding?  

D.
0
Comment
Question by:RobertGeoff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
John (Yiannis) Toutountzoglou earned 420 total points
ID: 38833818
Try
Dim Int As Integer
Private Sub TypeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TypeComboBox.SelectedIndexChanged

        

        If TypeComboBox.SelectedItem = "NonProv" Then
            Int = 360
        

        End If

    End Sub
------------------------------------

    Private Sub Alarm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Alarm_btn.Click
        'the below connects the first form with the second form.  

            If ObjForm Is Nothing Then ObjForm = New Form2(Int)
        ObjForm.ShowDialog

    End Sub
---------------------------------

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38834368
>however now I am unable to access the second form from via the button click event.

What you mean by that?
0
 

Author Closing Comment

by:RobertGeoff
ID: 38837558
jtoutou:
  Thanks for continuing to work with me.  Robert
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question