Click here to Skip to main content
15,899,679 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionactivex download problem Pin
Tabb Smith19-Dec-08 17:16
Tabb Smith19-Dec-08 17:16 
AnswerRe: activex download problem Pin
Christian Graus19-Dec-08 17:52
protectorChristian Graus19-Dec-08 17:52 
GeneralRe: activex download problem Pin
Tabb Smith21-Dec-08 12:20
Tabb Smith21-Dec-08 12:20 
QuestionLimit the movement of scrolling Picture Pin
yoyoaz7719-Dec-08 5:55
yoyoaz7719-Dec-08 5:55 
AnswerRe: Limit the movement of scrolling Picture Pin
Dave Kreskowiak19-Dec-08 7:52
mveDave Kreskowiak19-Dec-08 7:52 
GeneralRe: Limit the movement of scrolling Picture Pin
EliottA19-Dec-08 8:53
EliottA19-Dec-08 8:53 
AnswerRe: Limit the movement of scrolling Picture Pin
Christian Graus19-Dec-08 15:28
protectorChristian Graus19-Dec-08 15:28 
QuestionComboboxes and Collections Pin
LostMonkey19-Dec-08 3:41
LostMonkey19-Dec-08 3:41 
Hi everybody,

I'm VERY new to VB and need some guidance...it may be that I am just over complicating things by what I'm doing though - or what I am asking might not be possible - but here goes!!

I am writing a new app from scratch for my current employers and I have a few classes that are used to handle data access and management.

I have a class that represents a "Shop", so it has a shop number, address lines etc.

I have a seperate class called "Shops" which inherits from CollectionBase. The Items in Shops.List are populated by "Shop" objects. So I have a method called populatelist which uses a SqlDataReader to return a list of customer shops. I then traverse this list and create a "Shop" using field values in each datarow. I then Add(Shop) which populates my collection list.

This all seems to work fine.

However I want to connect my "Shops" collection to a combobox, so I tried code like the following: -

Dim aBind As New BindingSource

aBind.DataSource = oShopList
cboShopList.DataSource = aBind

cboShopList.DisplayMember = "ShopName"
cboShopList.ValueMember = "ShopNumber"

cboShopList.DataBindings.Clear()
cboShopList.DataBindings.Add("SelectedValue", aBind, "ShopNumber")

This populates the combo correctly, and refreshes nicely when I change customer.

BUT when I test my combobox, I get erratic results. I test what value the combobox returns and it changes sometimes when I change the selection, sometimes not. Whichever item I pick in the list, the display part of the combo always displays the first item after briefly displaying the item I chose...even when it sometimes changes the ValueMembers value...

I am using VB.Net 2.0 and the app is your bog standard, run-of-the-mill windows application.

Like I say, I'm new so not sure if I am way off beam here, but any advice at this point would be helpful!

Cheers,

A seriously LostMonkey...
AnswerRe: Comboboxes and Collections Pin
Christian Graus19-Dec-08 16:40
protectorChristian Graus19-Dec-08 16:40 
QuestionCreating Logon screen with SQL Connection Pin
Shrimpersfan19-Dec-08 1:17
Shrimpersfan19-Dec-08 1:17 
AnswerRe: Creating Logon screen with SQL Connection Pin
Jon_Boy19-Dec-08 1:42
Jon_Boy19-Dec-08 1:42 
GeneralRe: Creating Logon screen with SQL Connection Pin
Shrimpersfan19-Dec-08 3:00
Shrimpersfan19-Dec-08 3:00 
GeneralRe: Creating Logon screen with SQL Connection Pin
Dave Kreskowiak19-Dec-08 4:47
mveDave Kreskowiak19-Dec-08 4:47 
GeneralRe: Creating Logon screen with SQL Connection Pin
Shrimpersfan19-Dec-08 6:18
Shrimpersfan19-Dec-08 6:18 
GeneralRe: Creating Logon screen with SQL Connection Pin
Dave Kreskowiak19-Dec-08 7:48
mveDave Kreskowiak19-Dec-08 7:48 
Questionsplash screen to hold a some time to display to the mdiform Pin
jigneshDPatel19-Dec-08 0:53
jigneshDPatel19-Dec-08 0:53 
AnswerRe: splash screen to hold a some time to display to the mdiform Pin
Steven J Jowett19-Dec-08 1:18
Steven J Jowett19-Dec-08 1:18 
AnswerRe: splash screen to hold a some time to display to the mdiform Pin
Dave Kreskowiak19-Dec-08 4:43
mveDave Kreskowiak19-Dec-08 4:43 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
jigneshDPatel19-Dec-08 17:08
jigneshDPatel19-Dec-08 17:08 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
Dave Kreskowiak20-Dec-08 4:17
mveDave Kreskowiak20-Dec-08 4:17 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
jigneshDPatel21-Dec-08 16:53
jigneshDPatel21-Dec-08 16:53 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
Dave Kreskowiak21-Dec-08 18:29
mveDave Kreskowiak21-Dec-08 18:29 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
jigneshDPatel21-Dec-08 19:06
jigneshDPatel21-Dec-08 19:06 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
Dave Kreskowiak22-Dec-08 2:08
mveDave Kreskowiak22-Dec-08 2:08 
GeneralRe: splash screen to hold a some time to display to the mdiform Pin
jigneshDPatel22-Dec-08 17:42
jigneshDPatel22-Dec-08 17:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.