Click here to Skip to main content
15,500,824 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionLogging for Windows Form application Pin
lol240317-Jul-13 4:25
Memberlol240317-Jul-13 4:25 
AnswerRe: Logging for Windows Form application Pin
NotPolitcallyCorrect17-Jul-13 5:09
MemberNotPolitcallyCorrect17-Jul-13 5:09 
QuestionWinforms - automated retrieve static image Pin
fincity11-Jul-13 8:51
Memberfincity11-Jul-13 8:51 
AnswerRe: Winforms - automated retrieve static image Pin
Richard MacCutchan11-Jul-13 22:16
mveRichard MacCutchan11-Jul-13 22:16 
AnswerRe: Winforms - automated retrieve static image Pin
Eddy Vluggen9-Oct-13 8:30
professionalEddy Vluggen9-Oct-13 8:30 
QuestionError during tableAdapterManager.UpdateAll unable to resolve Pin
Member 838780830-Jun-13 9:02
MemberMember 838780830-Jun-13 9:02 
AnswerRe: Error during tableAdapterManager.UpdateAll unable to resolve Pin
Eddy Vluggen4-Jul-13 6:05
professionalEddy Vluggen4-Jul-13 6:05 
QuestionListBox does not update when DataSource is changed Pin
rbsbscrp17-May-13 6:36
Memberrbsbscrp17-May-13 6:36 
Well, I'm plum out of ideas. I've got a listbox with a List<> for its DataSource. When I init it - before the form is displayed, it works. But not after that. I am modifying the List<> contents and then I run:

C#
public void RefreshLbx()
{
    lbxQuotes.DataSource = null;
    lbxQuotes.DataSource = _quotes;
}


where _quotes is the List<>

Now here is where it gets weird. I put a button on the form - here's its handler:

C#
private void btnRefresh_Click(object sender, EventArgs e)
{
    RefreshLbx();
}


So that when I click on the button then the lbxQuotes listbox is properly updated. But in the modification code - where I call RefreshLbx() directly, nothing happens.

I even tried invoking btnRefresh_Click() in the code, but alas could not find the magic.

Oh one other thought - the modification code is in a timer event handler - could this be a problem of trying to modify a control from a different thread? All I am doing is changing the List<> contents and then reseting the DataSource.

I must be missing something to kick the listbox to redisplay, or something... HELP!
AnswerRe: ListBox does not update when DataSource is changed Pin
rbsbscrp17-May-13 7:59
Memberrbsbscrp17-May-13 7:59 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen24-May-13 3:59
professionalEddy Vluggen24-May-13 3:59 
GeneralRe: ListBox does not update when DataSource is changed Pin
Dave Kreskowiak24-May-13 6:23
mveDave Kreskowiak24-May-13 6:23 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp24-May-13 21:03
Memberrbsbscrp24-May-13 21:03 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen25-May-13 0:03
professionalEddy Vluggen25-May-13 0:03 
GeneralRe: ListBox does not update when DataSource is changed Pin
Dave Kreskowiak25-May-13 4:55
mveDave Kreskowiak25-May-13 4:55 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp30-May-13 15:16
Memberrbsbscrp30-May-13 15:16 
GeneralRe: ListBox does not update when DataSource is changed Pin
Dave Kreskowiak30-May-13 17:19
mveDave Kreskowiak30-May-13 17:19 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp30-May-13 18:38
Memberrbsbscrp30-May-13 18:38 
GeneralRe: ListBox does not update when DataSource is changed Pin
Dave Kreskowiak31-May-13 5:25
mveDave Kreskowiak31-May-13 5:25 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 6:41
Memberrbsbscrp31-May-13 6:41 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 7:29
professionalEddy Vluggen31-May-13 7:29 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 7:27
professionalEddy Vluggen31-May-13 7:27 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 8:22
Memberrbsbscrp31-May-13 8:22 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 8:30
professionalEddy Vluggen31-May-13 8:30 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 8:39
Memberrbsbscrp31-May-13 8:39 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 9:32
professionalEddy Vluggen31-May-13 9:32 

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.