Click here to Skip to main content
15,889,595 members
Home / Discussions / C#
   

C#

 
QuestionA second form from the first form, but both are active Pin
trottl10-May-18 23:18
trottl10-May-18 23:18 
AnswerRe: A second form from the first form, but both are active Pin
OriginalGriff10-May-18 23:25
mveOriginalGriff10-May-18 23:25 
GeneralRe: A second form from the first form, but both are active Pin
trottl10-May-18 23:32
trottl10-May-18 23:32 
GeneralRe: A second form from the first form, but both are active Pin
OriginalGriff10-May-18 23:47
mveOriginalGriff10-May-18 23:47 
AnswerRe: A second form from the first form, but both are active Pin
BillWoodruff12-May-18 0:00
professionalBillWoodruff12-May-18 0:00 
QuestionMultiple clicks on one button scrolls through selection choices Pin
Member 1382104810-May-18 5:19
Member 1382104810-May-18 5:19 
SuggestionRe: Multiple clicks on one button scrolls through selection choices Pin
Richard Deeming10-May-18 5:55
mveRichard Deeming10-May-18 5:55 
AnswerRe: Multiple clicks on one button scrolls through selection choices Pin
OriginalGriff10-May-18 6:06
mveOriginalGriff10-May-18 6:06 
Although knowing what environment you are working in would certainly help, the principle is the same in all environment, just the details will change.
The way I'd do it* is to create an array of strings:
private string[] Temperatures = { "30C", "40C", "60C", "90C" };
And a current setting variable:
private int currentTemp = 0;
Then each time the button was clicked I'd change it:
private void butTemp_Click(object sender, EventArgs e)
    {
    currentTemp++;
    if (currentTemp >= Temperatures.Length)
        {
        currentTemp = 0;
        }
    butTemp.Text = Temperatures[currentTemp];
    }



* Well, not really, I'd use a "TemperatureSetting" class instead of strings and temps to hold it all together - but that's the more advanced stuff.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Multiple clicks on one button scrolls through selection choices Pin
Luc Pattyn10-May-18 6:24
sitebuilderLuc Pattyn10-May-18 6:24 
GeneralRe: Multiple clicks on one button scrolls through selection choices Pin
OriginalGriff10-May-18 6:44
mveOriginalGriff10-May-18 6:44 
GeneralRe: Multiple clicks on one button scrolls through selection choices Pin
Luc Pattyn10-May-18 6:55
sitebuilderLuc Pattyn10-May-18 6:55 
GeneralRe: Multiple clicks on one button scrolls through selection choices Pin
OriginalGriff10-May-18 7:59
mveOriginalGriff10-May-18 7:59 
AnswerRe: Multiple clicks on one button scrolls through selection choices Pin
BillWoodruff10-May-18 10:56
professionalBillWoodruff10-May-18 10:56 
AnswerRe: Multiple clicks on one button scrolls through selection choices Pin
Pete O'Hanlon10-May-18 21:45
mvePete O'Hanlon10-May-18 21:45 
Questionc# while loop Pin
swathiii8-May-18 23:04
swathiii8-May-18 23:04 
AnswerRe: c# while loop Pin
OriginalGriff8-May-18 23:37
mveOriginalGriff8-May-18 23:37 
AnswerRe: c# while loop Pin
Pete O'Hanlon9-May-18 1:32
mvePete O'Hanlon9-May-18 1:32 
AnswerRe: c# while loop Pin
Luc Pattyn9-May-18 22:53
sitebuilderLuc Pattyn9-May-18 22:53 
Questionhow can i get the splitted values in a textbox from seperate line in c# using text file Pin
Mohamed Fahad M8-May-18 3:28
Mohamed Fahad M8-May-18 3:28 
AnswerRe: how can i get the splitted values in a textbox from seperate line in c# using text file Pin
OriginalGriff8-May-18 4:14
mveOriginalGriff8-May-18 4:14 
AnswerRe: how can i get the splitted values in a textbox from seperate line in c# using text file Pin
Eddy Vluggen8-May-18 5:51
professionalEddy Vluggen8-May-18 5:51 
GeneralRe: how can I ... Pin
Luc Pattyn8-May-18 7:16
sitebuilderLuc Pattyn8-May-18 7:16 
GeneralRe: how can I ... Pin
Eddy Vluggen8-May-18 7:43
professionalEddy Vluggen8-May-18 7:43 
AnswerRe: how can i get the splitted values in a textbox from seperate line in c# using text file Pin
BillWoodruff12-May-18 10:45
professionalBillWoodruff12-May-18 10:45 
Questionconversion from Uint32 to float Pin
sp love8-May-18 2:16
sp love8-May-18 2:16 

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.