4 Replies - 208 Views - Last Post: 31 January 2018 - 11:51 PM Rate Topic: -----

#1 dendenden  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-January 18

listbox and combobox items synchronizing, save and load

Posted 31 January 2018 - 05:55 AM

hello friends, I couldnt synchronize listbox select and combobox selects. you can see picture below user will add point and choice items from comboboxes for each point in listbox. now I cant save selected comboboxes items for selected listbox item and cant load these. Any suggestion or sample?

Posted Image

thats the picture
Is This A Good Question/Topic? 0
  • +

Replies To: listbox and combobox items synchronizing, save and load

#2 GazinAtCode  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 121
  • Joined: 26-September 16

Re: listbox and combobox items synchronizing, save and load

Posted 31 January 2018 - 03:01 PM

I'm afraid you haven't provided enough information. You haven't even shown us the relevant parts of your code. What happens when the user clicks "add point" or "ok"?
Was This Post Helpful? 0
  • +
  • -

#3 dendenden  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-January 18

Re: listbox and combobox items synchronizing, save and load

Posted 31 January 2018 - 11:04 PM

Public Class Form1

Dim Number As Integer
Dim Pl = New List(Of Nestedclass)()
Dim i As Nestedclass = New Nestedclass()

Dim a As Nestedclass.poles = New Nestedclass.Poles() With { .Price = 375, .Name = "T-8", .Type = "A28"}

Dim ps = New BindingSource With {
        .DataSource= Pl  }

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

i.Name = "point " & Number

Pl.Add(i)
Listbox1.Items.Add(i)

Number = Number + 1

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

     'THİS BUTTON SHOULD SAVE LİSTBOX AND COMBOBOXES İTEM

End Sub





here my code

This post has been edited by andrewsw: 31 January 2018 - 11:33 PM
Reason for edit:: fixed [code][/code] tags

Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • blow up my boots
  • member icon

Reputation: 6492
  • View blog
  • Posts: 26,272
  • Joined: 12-December 12

Re: listbox and combobox items synchronizing, save and load

Posted 31 January 2018 - 11:36 PM

What have you tried or considered? You must provide a clear question and describe what you have attempted.
Was This Post Helpful? 0
  • +
  • -

#5 dendenden  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-January 18

Re: listbox and combobox items synchronizing, save and load

Posted 31 January 2018 - 11:51 PM

I have tried this code but its not useful for me, because at the end of this process I need total item price which choosed in comboboxes, I need any suggestion any help.


Public Class Form1

Public list1 As Dictionary(Of String, String) = New Dictionary(Of String, String)()
Public list2 As Dictionary(Of String, String) = New Dictionary(Of String, String)()
Public list3 As Dictionary(Of String, String) = New Dictionary(Of String, String)()
Public list4 As Dictionary(Of String, String) = New Dictionary(Of String, String)()

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

list1.Add(listBox1.SelectedItem.ToString(),ComboBox1.Text)
list2.Add(listBox1.SelectedItem.ToString(),ComboBox2.Text)
list3.Add(listBox1.SelectedItem.ToString(),ComboBox3.Text)
list4.Add(listBox1.SelectedItem.ToString(),ComboBox4.Text)

End Sub

End Class


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1