Click here to Skip to main content
14,978,606 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: ListBox does not update when DataSource is changed Pin
Dave Kreskowiak31-May-13 4:25
mveDave Kreskowiak31-May-13 4:25 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 5:41
Memberrbsbscrp31-May-13 5:41 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 6:29
professionalEddy Vluggen31-May-13 6:29 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 6:27
professionalEddy Vluggen31-May-13 6:27 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 7:22
Memberrbsbscrp31-May-13 7:22 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 7:30
professionalEddy Vluggen31-May-13 7:30 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 7:39
Memberrbsbscrp31-May-13 7:39 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 8:32
professionalEddy Vluggen31-May-13 8:32 
rbsbscrp wrote:
the timer that I'm using is the System.Windows.Forms.Timer one
That one runs on the UI thread, and doesn't need any invocations to update controls created.
using System;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Thread.CurrentThread.Name = "UI Thread";
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Text = String.Format("{0}, {1}", Thread.CurrentThread.Name, Environment.TickCount);
            // Thread.Sleep(1000); Try resizing after uncommenting this
        }
    }
}
The timer is based on the Windows message-pump;
// System.Windows.Forms.Timer.TimerNativeWindow
protected override void WndProc(ref Message m)
{
	if (m.Msg == 275)
	{
		if ((int)m.WParam == this._timerID)
		{
			this._owner.OnTick(EventArgs.Empty);
			return;
		}
	}
	else
	{
		if (m.Msg == 16)
		{
			this.StopTimer(true, m.HWnd);
			return;
		}
	}
	base.WndProc(ref m);
}

Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: ListBox does not update when DataSource is changed Pin
TnTinMn6-Jun-13 9:08
MemberTnTinMn6-Jun-13 9:08 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp6-Jun-13 12:38
Memberrbsbscrp6-Jun-13 12:38 
GeneralRe: ListBox does not update when DataSource is changed Pin
TnTinMn6-Jun-13 13:26
MemberTnTinMn6-Jun-13 13:26 
AnswerRe: ListBox does not update when DataSource is changed Pin
Chirag Baroliya R24-May-13 2:25
MemberChirag Baroliya R24-May-13 2:25 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp24-May-13 20:11
Memberrbsbscrp24-May-13 20:11 
QuestionBinding a DataGridView column to a nullable property, using a ComboBox bound to a non-nullable property. Pin
Brady Kelly14-May-13 21:20
MemberBrady Kelly14-May-13 21:20 
QuestionControl hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 21:20
MemberkenmaMoon23-Apr-13 21:20 
AnswerRe: Control hide/show(should be post here, right?) Pin
Richard MacCutchan23-Apr-13 21:57
mveRichard MacCutchan23-Apr-13 21:57 
GeneralRe: Control hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 22:00
MemberkenmaMoon23-Apr-13 22:00 
GeneralRe: Control hide/show(should be post here, right?) Pin
Richard MacCutchan23-Apr-13 22:42
mveRichard MacCutchan23-Apr-13 22:42 
AnswerRe: Control hide/show(should be post here, right?) Pin
Eddy Vluggen23-Apr-13 22:50
professionalEddy Vluggen23-Apr-13 22:50 
GeneralRe: Control hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 22:55
MemberkenmaMoon23-Apr-13 22:55 
AnswerRe: Control hide/show(should be post here, right?) Pin
Eddy Vluggen24-Apr-13 6:29
professionalEddy Vluggen24-Apr-13 6:29 
QuestionC# Winform controls not drawing Pin
Member 783446019-Apr-13 7:01
MemberMember 783446019-Apr-13 7:01 
AnswerRe: C# Winform controls not drawing Pin
Eddy Vluggen22-Apr-13 8:52
professionalEddy Vluggen22-Apr-13 8:52 
QuestionChanging BackColor for tabControl Pin
_katon_11-Apr-13 2:54
Member_katon_11-Apr-13 2:54 
AnswerRe: Changing BackColor for tabControl Pin
Alan N11-Apr-13 3:48
MemberAlan N11-Apr-13 3:48 

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.