FYI, I tend to avoid circular linked lists; I typically use
either a single-linked list with a dummy head node,
or a double-linked list with a dummy head node and a dummy tail node (different from head);
reason is you can then walk the list forwards/backwards (without removing nodes) until
next/prev equals null.
Combining the head and tail dummies would save a node, but that is typically not worth the hassle (unless nodes are really big of course).
Well, I am using Visual C# 2005 express, and I am looking to start making a nice shiny program. My question now is, on a windows Form, how can I write code behind a button so that when it is compiled and run, a new, and completely functional new button can be formed? http://img102.imageshack.us/img102/8792/randomng3.jpg
So basically, disregarding the captions I put on the buttons, how on demand of a click, can I make an exact copy of the button clicked, 5 or however many pixels to the left (or right, or above, whatever)?
Take those pieces of code and replicate them when you need.
private void InitializeComponent()
this.button1 = new System.Windows.Forms.Button();
this.button1.Location = new System.Drawing.Point(62, 54);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
private System.Windows.Forms.Button button1;
Ok, with some editting there is all the information regarding button1, so I have tried copying and pasting all and parts of the code into any place that makes sense, and either it tells me
"Type or namespace, or end of file expected", or it compiles and nothing happens upon button click. So then I change all the places where it says button1 to button2, and of course it tells me "We don't have a definition for button2"...
Can anyone spare the time to be a bit more specific
If I remember correctly, the double click is actually broken down into 2 clicks: a click for the datagrid and another one for the datagrid cell. To achieve what you want, you either use a context menu (allowing the user to do multiple things, among them the action required by your double click), or you extend the datagrid class and try to capture the double click event.
hi thanks for your reply
my problem is, datagrid doesnt have cellcontentdoubleclick but datagridview has cellcontentdoubleclick. and i have to use datagrid. beucase i wrote 6,7 pages code i cannot change
Now how can i use context menu i didnt use it before