Hi i would like to ask how to show information in the listbox in the form after making reservation in previous form?
5 Replies - 219 Views - Last Post: 20 October 2019 - 02:07 AM
#1
information in the listbox frm aftermaking reservation in previous fr
Posted 19 October 2019 - 12:47 AM
Replies To: information in the listbox frm aftermaking reservation in previous fr
#2
Re: information in the listbox frm aftermaking reservation in previous fr
Posted 19 October 2019 - 08:00 AM
Depends on a number of things.
Platform, how days is processed, what days is there, etc.
Platform, how days is processed, what days is there, etc.
#3
Re: information in the listbox frm aftermaking reservation in previous fr
Posted 19 October 2019 - 10:42 PM
Like how?
#4
Re: information in the listbox frm aftermaking reservation in previous fr
Posted 19 October 2019 - 11:03 PM
Again I would need more information.
Is this winforms, asp.net, some funky wpf, access form, etc?
What 'information'? What type? Quantity?
Is this winforms, asp.net, some funky wpf, access form, etc?
What 'information'? What type? Quantity?
#5
Re: information in the listbox frm aftermaking reservation in previous fr
Posted 20 October 2019 - 12:04 AM
This the code of reservation form in visual basic.

And after fill up the reservation form, how to show the information to another form in the listbox?
Public Class frmReservation Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click frmBookingList.Show() End Sub Private Sub BtnCancel7_Click(sender As Object, e As EventArgs) Handles btnCancel7.Click frmMyAccount.Show() Me.Hide() End Sub Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles btnConfirm.Click Dim company As String Dim Reservation As String Dim Venue As String Dim StartDate As Date Dim EndDate As Date Dim StartTime As String Dim EndTime As String Dim ReservebyStaff As String company = txtCompany.Text Reservation = cmbRervationID.SelectedItem Venue = cmbVenueID.SelectedItem StartDate = dtpRSD.Value EndDate = dtpRED.Value StartTime = cmbST.SelectedItem EndTime = cmbET.SelectedItem ReservebyStaff = chkRbStaff.Checked 'fill up the blanks If company = "" Or Reservation = "" Or Venue = "" Or StartTime = "" Or EndTime = "" Or ReservebyStaff = "" Then MsgBox("Please fill up the details.") ' if the venue is book on that day and time, please select another day, time and venue Else MsgBox("Thank you for your reservation.") Me.Hide() frmShowVenue.Show() End If End Sub Private Sub FrmReservation_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class

And after fill up the reservation form, how to show the information to another form in the listbox?
This post has been edited by modi123_1: 20 October 2019 - 12:15 AM
#6
Re: information in the listbox frm aftermaking reservation in previous fr
Posted 20 October 2019 - 02:07 AM
A few things come to mind.
First - treat form objects as just that, objects. You need to instantiate them to have coherent chance at data usage.
This is wrong.
You would want to declare an instance of 'frmMyAccount' and then show that object.
Example:
That way you can pass data to and from forms.
Ex:
That is going to be the chief way to pass data to your listbox, or any control for that matter - create an instance of the form, interact with public properties and objects, and handle any return to the calling thread/form/method after it closes.
First - treat form objects as just that, objects. You need to instantiate them to have coherent chance at data usage.
This is wrong.
11 frmMyAccount.Show()
You would want to declare an instance of 'frmMyAccount' and then show that object.
Example:
Dim f2 As New Form2 f2.Show()
That way you can pass data to and from forms.
Ex:
Dim f2 As New Form2 f2.TextBox1.Text = "foo" f2.Show()
That is going to be the chief way to pass data to your listbox, or any control for that matter - create an instance of the form, interact with public properties and objects, and handle any return to the calling thread/form/method after it closes.
Page 1 of 1