Click here to Skip to main content
14,238,683 members
   

C#

 
AnswerRe: last 3 numbers Pin
#realJSOP18-Apr-19 2:04
mve#realJSOP18-Apr-19 2:04 
AnswerRe: last 3 numbers Pin
BillWoodruff18-Apr-19 20:57
mveBillWoodruff18-Apr-19 20:57 
QuestionWCF Pin
Member 1406752317-Apr-19 4:12
memberMember 1406752317-Apr-19 4:12 
AnswerRe: WCF Pin
#realJSOP17-Apr-19 4:25
mve#realJSOP17-Apr-19 4:25 
QuestionReferencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 12:11
memberMember 1427108416-Apr-19 12:11 
AnswerRe: Referencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 15:38
memberMember 1427108416-Apr-19 15:38 
SuggestionRe: Referencing Dynamic Control Array Data Pin
Richard Deeming17-Apr-19 1:07
mveRichard Deeming17-Apr-19 1:07 
AnswerRe: Referencing Dynamic Control Array Data Pin
BillWoodruff16-Apr-19 16:29
mveBillWoodruff16-Apr-19 16:29 
Since you create the Buttons at run-time, why not keep track of them and their current index as you create them ? You can then serialize them.
// untested code

public Dictionary<string, Button> BtnDict = new Dictionary<string, Button>();

public void AddNewButton(ImageList btnimagelist, Control btnsite, string btntext, int btnimgindex, Point btnlocation)
{
    Button btn = new Button
    {
        Text = btntext,
        ImageList = btnimagelist,
        ImageIndex = btnimgindex,
        Location = btnlocation
    };

    btnsite.Controls.Add(btn);
}

public void IncBtnImage(string btntext)
{
    Button btn = BtnDict[btntext];

    int icnt = btn.ImageList.Images.Count;

    int ndx = ++btn.ImageIndex;

    if (ndx == icnt) ndx = 0; // assumes you return to first image

    btn.ImageIndex = ndx;
}
Do all of these run-time created Buttons use the same ImageList, or does each one have its own ?
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot


modified 17-Apr-19 3:00am.

AnswerRe: Referencing Dynamic Control Array Data Pin
OriginalGriff16-Apr-19 21:22
protectorOriginalGriff16-Apr-19 21:22 
QuestionJson formatting using an object in c# Pin
ATLDev15-Apr-19 11:52
memberATLDev15-Apr-19 11:52 
AnswerRe: Json formatting using an object in c# Pin
OriginalGriff15-Apr-19 21:21
protectorOriginalGriff15-Apr-19 21:21 
GeneralRe: Json formatting using an object in c# Pin
Rob Philpott16-Apr-19 6:21
memberRob Philpott16-Apr-19 6:21 
AnswerRe: Json formatting using an object in c# Pin
Richard Deeming16-Apr-19 7:47
mveRichard Deeming16-Apr-19 7:47 
GeneralRe: Json formatting using an object in c# Pin
ATLDev18-Apr-19 6:08
memberATLDev18-Apr-19 6:08 
GeneralRe: Json formatting using an object in c# Pin
Richard Deeming18-Apr-19 7:30
mveRichard Deeming18-Apr-19 7:30 
QuestionHow to fill between two spline curves with two different colors in C# Pin
Member 1332584612-Apr-19 10:01
memberMember 1332584612-Apr-19 10:01 
AnswerRe: How to fill between two spline curves with two different colors in C# Pin
Gerry Schmitz13-Apr-19 5:49
mveGerry Schmitz13-Apr-19 5:49 
AnswerRe: How to fill between two spline curves with two different colors in C# Pin
jschell13-Apr-19 6:17
memberjschell13-Apr-19 6:17 
AnswerRe: How to fill between two spline curves with two different colors in C# Pin
RodStephens13-Apr-19 6:40
memberRodStephens13-Apr-19 6:40 
QuestionTalk Over Mic To Remote PCs Pin
Kevin Marois11-Apr-19 10:57
professionalKevin Marois11-Apr-19 10:57 
AnswerRe: Talk Over Mic To Remote PCs Pin
Richard MacCutchan11-Apr-19 20:30
protectorRichard MacCutchan11-Apr-19 20:30 
GeneralRe: Talk Over Mic To Remote PCs Pin
Kevin Marois12-Apr-19 4:34
professionalKevin Marois12-Apr-19 4:34 
GeneralRe: Talk Over Mic To Remote PCs Pin
Gerry Schmitz12-Apr-19 5:02
mveGerry Schmitz12-Apr-19 5:02 
GeneralRe: Talk Over Mic To Remote PCs Pin
#realJSOP12-Apr-19 5:11
mve#realJSOP12-Apr-19 5:11 
GeneralRe: Talk Over Mic To Remote PCs Pin
Gerry Schmitz12-Apr-19 9:18
mveGerry Schmitz12-Apr-19 9:18 

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.