Thanks for the tip, but I figured it out elsewhere from a MUCH more helpful place.
frogb0x
Posts
-
Loading a new image into a PictureBox? -
Loading a new image into a PictureBox?Oh how helpful. Not only do I get code to load an image but my C: drive gets formatted. Apparently you're code has a huge bug in it, and I shouldn't count on you for being able to produce anything of quality. Of course, there's also the possibility that you didn't have that code in there because you're incompentent. You could also just be a self-righteous asshole. I'll let you decide which of the two you are.
-
Loading a new image into a PictureBox?No, no. This I understand. Its more of a syntax question than anything else. I understand what an event is, and how to use them, etc etc. Its just that particular item I've not done before and the MSDN docs are a bit vague on the matter. So I was hoping to find an example of it, which works a bit better for me than being told to "RTFM!"
-
Loading a new image into a PictureBox?Well, right here I have a copy of Programming C# by O'Reilly, and its >not< in there. At least its not in a place that I was able to find. I have another C# elsewhere that didn't have it either.
-
Loading a new image into a PictureBox?I actually own several. Unfortunately this particular item is in none of them.
-
Loading a new image into a PictureBox?I'm still not sure how to make it. Could you code up a quick example?
-
Loading a new image into a PictureBox?How can I load a new image into a PictureBox when the user clicks on that PictureBox?
-
Get/set method for an array?Well, I have a class Foo(). Inside Foo is a private array of another class, Bar(). public Foo() { private Bar[] myBars = new Bar[10]; } When I instantiate Foo, I need to be able to assign a value to the array of Bars: myFoo.myBars[n].someValue = 10; So how can I do this?
-
Get/set method for an array?Hey all, How can I create a get/set method that returns the Nth item of an array?
-
Displaying Version and Build info in my program.Is there a way to make it just show the major/minor version? Or only the build number?
-
Displaying Version and Build info in my program.Hey all, I'm wondering how I can get the version and build info from AssemblyInfo.cs to display in my program. I'm making an "About Box" and I'd like to be able to display this info on a label in the box. Can anyone help me out?
-
How can I make one Form show another?So it seems that's the only way to do it, eh? Cool. Thanks for all your help! :)
-
How can I make one Form show another?I went into the Closed event for Form2 and just put in this line, which works: Application.Exit(); Still, I'd like to know if there's a way to do it without having to add that. PS: Since I'm posting so much, I thought I should hunt down my p/w and login! ;)
-
Making one user control aware of anotherI think that should work. Is there a good primer on Events and the EventHandler() method in general, somewhere?
-
Making one user control aware of anotherIf it helps, here my code: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace Copper { public class frmInit : System.Windows.Forms.Form { private System.Windows.Forms.PictureBox pictureBox1; private Copper.UCInit ucInit1; private System.ComponentModel.Container components = null; public frmInit() { InitializeComponent(); UCCreate newPanel = new UCCreate(); newPanel.Location = new Point(376, 8); newPanel.Size = new Size (280, 140); this.Parent.Controls.Add(newPanel); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmInit)); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.ucInit1 = new Copper.UCInit(); this.SuspendLayout(); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(375, 256); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // // ucInit1 // this.ucInit1.Location = new System.Drawing.Point(376, 8); this.ucInit1.Name = "ucInit1"; this.ucInit1.Size = new System.Drawing.Size(280, 184); this.ucInit1.TabIndex = 0; this.ucInit1.Load += new System.EventHandler(this.ucInit1_Load); // // frmInit // this.
-
Making one user control aware of anotherHello, I have a problem that I'm still stuck on. I have a form with a pair of user controls. The first user control is displayed when the program runs. When a button is clicked, I want the first user control to remove itself from the form, and the second user control to appear. However, when I write the code for the button, all I can do is get the first UC to disappear; the second UC never draws itself. Someone earlier told me to instantiate an instance of the second user control in the form's constructor, and add this line into the form: this.Parent.Controls.Add(newUserControl); However, this still doesn't solve the issue of the first user control not knowing about the second user control. Can someone point me in the right direction?
-
Displaying a second user control in a formSo once I add that code into the constructor of my form, how does the first user control know about it? That is, how do I let other Controls know that newPanel exists? Thanks for the tip! :)
-
Displaying a second user control in a formStill no love. This is my amended code: private void btnCreate_Click(object sender, System.EventArgs e) { this.Hide(); UCCreate newPanel = new UCCreate(); newPanel.Location = new Point(376, 8); newPanel.Size = new Size (280, 140); this.Controls.Add(newPanel); newPanel.Show(); }
-
Displaying a second user control in a formI'm having a problem making a User Control display upon a form in C#. My form starts off with a single UC on it. Its called UCInit. UCInit contains some text and a couple of buttons. When one of the buttons is clicked, I want UCInit to remove itself from the form, and a second User Control, called UCCreate, to appear. I can get rid of the first UserControl, but UCCreate never appears. This is my code so far for when the button in UCInit is clicks: private void btnCreate_Click(object sender, System.EventArgs e) { this.Hide(); UCCreate newPanel = new UCCreate(); newPanel.Location = new Point (376, 8); newPanel.Show(); } UCInit removes itself but the instance of UCCreate never shows itself. What am I doing wrong?