Click here to Skip to main content
15,923,142 members
Home / Discussions / C#
   

C#

 
QuestionJoin video on-the-fly Pin
karnalta15-Sep-05 23:36
karnalta15-Sep-05 23:36 
QuestionHow to use < sign in comments? Pin
Dr Reedo15-Sep-05 23:09
Dr Reedo15-Sep-05 23:09 
AnswerRe: How to use < sign in comments? Pin
g00fyman15-Sep-05 23:17
g00fyman15-Sep-05 23:17 
GeneralRe: How to use &lt; sign in comments? Pin
Dr Reedo16-Sep-05 1:16
Dr Reedo16-Sep-05 1:16 
GeneralRe: How to use &lt; sign in comments? Pin
g00fyman16-Sep-05 1:17
g00fyman16-Sep-05 1:17 
QuestionProblems with Array being readonly (HELP) Pin
Yannielsen15-Sep-05 22:28
Yannielsen15-Sep-05 22:28 
GeneralRe: Problems with Array being readonly (HELP) Pin
Guffa16-Sep-05 0:31
Guffa16-Sep-05 0:31 
GeneralRe: Problems with Array being readonly (HELP) Pin
Yannielsen16-Sep-05 0:56
Yannielsen16-Sep-05 0:56 
// Declare a new ButtonArray object.
ButtonArray btnArray;
ButtonArray tempArray;

btnArray = new ButtonArray(this);
tempArray = new ButtonArray(this);

private void CopyArray()
{
try
{
if(btnArray.Count > 0)
{
int iCounter;
for (int iButtonIndex = 0; iButtonIndex < btnArray.Count; iButtonIndex++)
{
if (btnArray[iButtonIndex] != null)
{
tempArray[iCounter++] = btnArray[iButtonIndex];
iCounter++;
}
}
}
else
{
MessageBox.Show("(COPY) ARRAY IS EMPTY");
}

}
catch(Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1);
}
}


----------------------------------------------------------------
CODE FOR BUTTONARRAY.CS BELOW
----------------------------------------------------------------
using System;

namespace ButtonArray
{
public class ButtonArray : System.Collections.CollectionBase
{
private readonly System.Windows.Forms.Form HostForm;

public System.Windows.Forms.Button AddNewButton()
{
// Create a new instance of the Button class.
System.Windows.Forms.Button aButton = new System.Windows.Forms.Button();

// Add the button to the collection's internal list.
this.List.Add(aButton);

// Add the button to the controls collection of the form
// referenced by the HostForm field.
HostForm.Controls.Add(aButton);

// Set intial properties for the button object.
aButton.Top = Count * 25;
aButton.Left = 100;
aButton.Tag = this.Count;
aButton.Text = "Button " + this.Count.ToString();
aButton.Click += new System.EventHandler(ClickHandler);

return aButton;
}
public ButtonArray(System.Windows.Forms.Form host)
{
HostForm = host;
this.AddNewButton();
}

public System.Windows.Forms.Button this [int Index]
{
get
{
return (System.Windows.Forms.Button) this.List[Index];
}
}

public void Remove(int iRemoveX)
{
// Check to be sure there is a button to remove.
if (this.Count > 0)
{
// Remove the last button added to the array from the host form
// controls collection. Note the use of the indexer in accessing
// the array.
// Remove the button indexed with the value of iRemoveX
HostForm.Controls.Remove(this[iRemoveX]);
this.List.RemoveAt(this.Count -1);
}
}

public void ClickHandler(Object sender, System.EventArgs e)
{
System.Windows.Forms.MessageBox.Show("You have clicked button " +
((System.Windows.Forms.Button) sender).Tag.ToString());
}
}
}
GeneralRe: Problems with Array being readonly (HELP) Pin
Guffa16-Sep-05 1:59
Guffa16-Sep-05 1:59 
GeneralRe: Problems with Array being readonly (HELP) Pin
Yannielsen16-Sep-05 2:12
Yannielsen16-Sep-05 2:12 
GeneralRe: Problems with Array being readonly (HELP) Pin
Guffa16-Sep-05 5:11
Guffa16-Sep-05 5:11 
GeneralRe: Problems with Array being readonly (HELP) Pin
Yannielsen19-Sep-05 10:13
Yannielsen19-Sep-05 10:13 
QuestionDataGrid/DataGridBoolColumn - event Pin
JuergenLissmann15-Sep-05 21:48
JuergenLissmann15-Sep-05 21:48 
QuestionHow to override the Text property of Control class? Pin
dreamwinter15-Sep-05 20:54
dreamwinter15-Sep-05 20:54 
AnswerRe: How to override the Text property of Control class? Pin
Libra15-Sep-05 23:33
Libra15-Sep-05 23:33 
QuestionSearching in Linked List Pin
Member 204556015-Sep-05 20:54
Member 204556015-Sep-05 20:54 
AnswerRe: Searching in Linked List Pin
g00fyman15-Sep-05 22:56
g00fyman15-Sep-05 22:56 
AnswerRe: Searching in Linked List Pin
enjoycrack15-Sep-05 22:56
enjoycrack15-Sep-05 22:56 
AnswerRe: Searching in Linked List Pin
S. Senthil Kumar16-Sep-05 5:13
S. Senthil Kumar16-Sep-05 5:13 
QuestionCreating Custom Shaped Windows Forms Pin
Member 204556015-Sep-05 20:21
Member 204556015-Sep-05 20:21 
AnswerRe: Creating Custom Shaped Windows Forms Pin
g00fyman15-Sep-05 23:05
g00fyman15-Sep-05 23:05 
QuestionInputting data in Graphics of C. Pin
Rana isthiaq Ahamd15-Sep-05 19:26
Rana isthiaq Ahamd15-Sep-05 19:26 
QuestionHow do I get a HACK task to span multiple lines? Pin
Vikram A Punathambekar15-Sep-05 19:18
Vikram A Punathambekar15-Sep-05 19:18 
AnswerRe: How do I get a HACK task to span multiple lines? Pin
turbochimp16-Sep-05 17:14
turbochimp16-Sep-05 17:14 
GeneralRe: How do I get a HACK task to span multiple lines? Pin
Vikram A Punathambekar18-Sep-05 17:35
Vikram A Punathambekar18-Sep-05 17:35 

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.