//private Tweet theTweet; //private Object tweets = Search.SearchTweets("hackru"); public Popup(TweetObj twitterObject) { InitializeComponent(); // We want our window to be the top most TopMost = true; // Pop doesn't need to be shown in task bar ShowInTaskbar = false; //Border style FormBorderStyle = FormBorderStyle.FixedToolWindow; BackColor = Color.White; // Create and run timer for animation timer = new Timer(); timer.Interval = 2; timer.Tick += timer_Tick; //tweetbox.Enabled = false; avatar.Load(twitterObject.picture); tweetbox.Text = twitterObject.message; label1.Text = twitterObject.username; //TwitterCredentials.SetCredentials("UMEqCSDmN1g0fWFGvMDJRFmU9", "Oijm3yEu3msMqVfsAuCZJY2QmdboaaTfVj5E4gouHRkfr8idkt", "3180092943-4as7GXzJjyPNpqKXJL2OFQGDPAIUE3EbfqIc8ZI", "2Bc0BtaWzZauJC8r2btjyi9nQyTcTb6m4U7zv4LX01w9Q"); }
private void tweetElement(TweetObj twitterObject, int location) { if (this.InvokeRequired) { this.Invoke( new MethodInvoker(delegate { formMain.IsMdiContainer = true; Form frmchild = new Form(); frmchild.MdiParent = this; frmchild.Show(); frmchild.Size = new Size(980, 170); frmchild.Location = new System.Drawing.Point(10, 10 + 160 * location); frmchild.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; PictureBox userPicture = new PictureBox(); userPicture.Load(twitterObject.picture); //userPicture.Image = image; userPicture.Size = new System.Drawing.Size(90, 90); userPicture.Location = new System.Drawing.Point(10, 10); userPicture.SizeMode = PictureBoxSizeMode.StretchImage; Label usernameLabel = new Label(); usernameLabel.Location = new System.Drawing.Point(10, 105); usernameLabel.Text = "@" + twitterObject.username; usernameLabel.Size = new Size(usernameLabel.PreferredWidth, usernameLabel.PreferredHeight); usernameLabel.TextAlign = ContentAlignment.MiddleCenter; TextBox messageBox = new TextBox(); messageBox.Size = new System.Drawing.Size(850, 110); messageBox.Location = new System.Drawing.Point(110, 10); messageBox.Text = twitterObject.message; messageBox.Multiline = true; messageBox.Font = new Font(messageBox.Font.FontFamily, 16); formMain.usersTweets.Controls.Add(frmchild); frmchild.Controls.Add(userPicture); frmchild.Controls.Add(usernameLabel); frmchild.Controls.Add(messageBox); })); } else { formMain.IsMdiContainer = true; Form frmchild = new Form(); frmchild.MdiParent = this; frmchild.Show(); frmchild.Size = new Size(980, 170); frmchild.Location = new System.Drawing.Point(10, 10 + 160 * location); frmchild.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; PictureBox userPicture = new PictureBox(); userPicture.Load(twitterObject.picture); //userPicture.Image = image; userPicture.Size = new System.Drawing.Size(90, 90); userPicture.Location = new System.Drawing.Point(10, 10); userPicture.SizeMode = PictureBoxSizeMode.StretchImage; Label usernameLabel = new Label(); usernameLabel.Location = new System.Drawing.Point(10, 105); usernameLabel.Text = "@" + twitterObject.username; usernameLabel.Size = new Size(usernameLabel.PreferredWidth, usernameLabel.PreferredHeight); usernameLabel.TextAlign = ContentAlignment.MiddleCenter; TextBox messageBox = new TextBox(); messageBox.Size = new System.Drawing.Size(850, 110); messageBox.Location = new System.Drawing.Point(110, 10); messageBox.Text = twitterObject.message; messageBox.Multiline = true; messageBox.Font = new Font(messageBox.Font.FontFamily, 16); formMain.usersTweets.Controls.Add(frmchild); frmchild.Controls.Add(userPicture); frmchild.Controls.Add(usernameLabel); frmchild.Controls.Add(messageBox); } }