Solved

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

Posted on 2013-01-29
3
239 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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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