problems with loading forms and firing off picBox click events


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: problems with loading forms and firing off picBox click events

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Posts
    24

    problems with loading forms and firing off picBox click events

    Hi,

    [5][green]Form and PictureBox Help[/green][/5]
    I am working a project that is suppose to load a startup welcome form then close the frmwelcome(1 st form) and then open the main form ( ane once i close the second i want it to close everything).
    Also I am having problem with the click events for picBox i have used the .net drop down menu to create the events but for some reason they just don't fire off the events. The only event that work is the mnuExit even on a menu list and that's it.

    Any one can help it sure would be appreciated thx.

    [3][green]ADO.Net Help[/green][/3]
    Also if anyone could give me some advice on ado.net, what my program is suppose to do is when i click on the table(circles) it will show the name of the people sitting there and the table number. And when i double click it will clear the table and the fields will be black. thx





    [3][red]Splash welcome Code[/red][/3]

    Public Class frmWelcome
    Inherits System.Windows.Forms.Form
    ' Private mblnOKtoHide As Boolean = False
    Private Timing As Integer = 100

    #Region " Windows Form Designer generated code "

    #End Region

    Private Sub frmWelcome_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load

    ' display form then close and load booking form
    Me.Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Timer1.Tick
    Me.close -= 0.01
    If Me.Opacity = 0 Then
    ' mblnOKtoHide = True
    Me.Close()
    End If
    End Sub
    End Class



    [5][green]main form with the picboxes and other items[/green][/5]



    Public Class frmBookingDay
    Inherits System.Windows.Forms.Form

    #Region " Windows Form Designer generated code "

    #End Region

    Private Sub mnuExit_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles mnuExit.Click

    ' close program
    Me.Close()
    End Sub ' mnuExit_Click()

    Private Sub picDayTableOne_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableOne.Click

    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub


    Private Sub picDayTableTwo_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableTwo.Click

    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub


    Private Sub picDayTableThree_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableThree.Click


    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub PicDayTableFour_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles PicDayTableFour.Click

    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableFive_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableFive.Click

    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableSix_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableSix.Click

    '- Store the text entered to limit the list box to the
    ' data adapter's parameter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.txtDayTable.Text
    '- Clear the current data in the dataset
    Me.DataSet11.Clear()

    '- Fill the customer list dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableOne_DoubleClick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableOne.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()

    End Sub

    Private Sub pinDayTableTwo_DoubleClick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableTwo.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableThree_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picDayTableThree.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub PicDayTableFour_DoubleClick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles PicDayTableFour.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableFive_DoubleClick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableFive.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub

    Private Sub picDayTableSix_DoubleClick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles picDayTableSix.DoubleClick

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Fill the initial entry's individual dataset
    RefreshIndividual()
    End Sub


    Private Sub RefreshIndividual()

    '- Clear individual customer dataset
    Me.DataSet11.Clear()

    '- Check to see if an item was selected

    '- Store the selected customer ID into the
    ' parameter of the SQL data adapter
    Me.OleDbDataAdapter1.SelectCommand.Parameters(0).Value = _
    Me.picDayTableOne.Text

    '- Fill the dataset
    Me.OleDbDataAdapter1.Fill(Me.DataSet11)
    End Sub ' RefreshIndividual()


    Private Sub mnuAbout_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles mnuAbout.Click

    Dim output As String

    output &= "Restaurant Reservation System version 1.0.00.1" & vbCrLf & vbCrLf & _
    "CopyRight 2005 Employee Inc."

    MessageBox.Show(output, "Regina's Seafood. Reservation System", _
    MessageBoxButtons.OK, MessageBoxIcon.Information)

    End Sub

    Private Sub frmBookingDay_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load

    'Dim F1 As New frmWelcome ' Object variable
    ' F1.Show()
    ' If Not IsNothing(F2) Or Not F2.IsDisposed Then F2.Close()


    End Sub
    End Class ' booking
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Posts
    11
    Here is an answer to part of your problem; VB.NET code is as follows:
    >> main form ( ane once i close the second i want it to close everything).
    Private Sub frmSample_Closing(ByVal sender As Object, _
    ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    End
    End Sub

Similar Threads

  1. Windows Forms with listbox (Click Event)
    By Steve Hall in forum .NET
    Replies: 0
    Last Post: 04-03-2002, 04:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center