Hey~ I'm working on my Twitter application (I don't know if you've already seen it, it's
here if you want to see)
I had this feature working, and then I changed the code a little. Now, I can't remember for the life of me how to get it working again.
First off, I initialise "latest" on the main form's load event.
Then, in the thread, I call the function to update the "friend updates" panel (check the project thread) to add the latest to the top if it isn't already there.
So, here's the code which is being called via the Invoke() method of my panel:
csharp
void UpdateIt()
{
Twitter.Tweet check = Twitter.GetLatestUpdateFromHome(this.username, this.password);
if (this.latest.Name != check.Name && this.latest.Content != check.Content)
{
int y = 0;
foreach (Control ctrl in this.FriendUpdates.Controls)
{
y += 100;
ctrl.Location = new Point(ctrl.Location.X, y);
}
Panel p = new FriendPanel(latest.Name, latest.Content, latest.Picture);
this.FriendUpdates.Controls.Add(p);
this.latest = check;
}
}
Basically, I'm aiming to move them all down by 100 (their height) and add a new one to the top. That looks fine to me~
The problem is that the if statement never seems to be entered. (I've come to this conclusion by putting a MessageBox before/after the if statement~ the first is shown (indicating that the method is being called correctly) but the if isn't being entered.
Thanks in advance
-Danny