Click here to Skip to main content
15,037,420 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to add frame and Label controls at the same time by clicking a button in Xamarin? Pin
Gerry Schmitz1-Jul-21 7:20
mveGerry Schmitz1-Jul-21 7:20 
GeneralRe: How to add frame and Label controls at the same time by clicking a button in Xamarin? Pin
Alex Dunlop1-Jul-21 7:27
MemberAlex Dunlop1-Jul-21 7:27 
Questionshow the Name of ID datagridView cell0 to cell1 Pin
remiki1-Jul-21 0:21
Memberremiki1-Jul-21 0:21 
AnswerRe: show the Name of ID datagridView cell0 to cell1 Pin
Richard Deeming1-Jul-21 0:46
mveRichard Deeming1-Jul-21 0:46 
GeneralRe: show the Name of ID datagridView cell0 to cell1 Pin
remiki1-Jul-21 1:31
Memberremiki1-Jul-21 1:31 
AnswerRe: show the Name of ID datagridView cell0 to cell1 Pin
OriginalGriff1-Jul-21 1:02
mveOriginalGriff1-Jul-21 1:02 
QuestionHow to count Label controls count in Xamarin? Pin
Alex Dunlop29-Jun-21 4:56
MemberAlex Dunlop29-Jun-21 4:56 
AnswerRe: How to count Label controls count in Xamarin? Pin
Richard Deeming29-Jun-21 5:24
mveRichard Deeming29-Jun-21 5:24 
Your WinForms code would be better written as:
C#
int count = 0;
foreach (Label l in this.Controls.OfType<Label>())
{
    if (l.BackColor == Color.Red)
    {
        count++;
    }
}
Or simply:
C#
int count = this.Controls.OfType<Label>().Count(l => l.BackColor == Color.Red);

Xamarin forms doesn't have a similar concept. You might be able to do something similar by walking the visual tree - eg:
the urban canuk, eh: VisualTreeHelper for Xamarin.Forms[^]

However, it would almost certainly be better to use MVVM concepts to achieve your goal.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionPassing parameter from one page to another Pin
Alex Dunlop28-Jun-21 6:59
MemberAlex Dunlop28-Jun-21 6:59 
AnswerRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 7:02
mveGerry Schmitz28-Jun-21 7:02 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop28-Jun-21 7:08
MemberAlex Dunlop28-Jun-21 7:08 
GeneralRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 7:29
mveGerry Schmitz28-Jun-21 7:29 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop28-Jun-21 7:34
MemberAlex Dunlop28-Jun-21 7:34 
GeneralRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 8:02
mveGerry Schmitz28-Jun-21 8:02 
GeneralRe: Passing parameter from one page to another Pin
Richard Andrew x6428-Jun-21 14:23
professionalRichard Andrew x6428-Jun-21 14:23 
GeneralRe: Passing parameter from one page to another Pin
Richard MacCutchan28-Jun-21 21:13
mveRichard MacCutchan28-Jun-21 21:13 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop29-Jun-21 4:53
MemberAlex Dunlop29-Jun-21 4:53 
GeneralRe: Passing parameter from one page to another Pin
Richard MacCutchan29-Jun-21 5:44
mveRichard MacCutchan29-Jun-21 5:44 
QuestionCreate the same but in windows form C# Pin
Luis M. Rojas25-Jun-21 6:16
MemberLuis M. Rojas25-Jun-21 6:16 
AnswerRe: Create the same but in windows form C# Pin
OriginalGriff25-Jun-21 6:23
mveOriginalGriff25-Jun-21 6:23 
QuestionDifficulty adding code to reject non numeric user inputs Pin
Member 1524886723-Jun-21 5:58
MemberMember 1524886723-Jun-21 5:58 
AnswerRe: Difficulty adding code to reject non numeric user inputs Pin
OriginalGriff23-Jun-21 6:08
mveOriginalGriff23-Jun-21 6:08 
GeneralRe: Difficulty adding code to reject non numeric user inputs Pin
Member 1524886723-Jun-21 7:15
MemberMember 1524886723-Jun-21 7:15 
GeneralRe: Difficulty adding code to reject non numeric user inputs Pin
OriginalGriff23-Jun-21 7:32
mveOriginalGriff23-Jun-21 7:32 
GeneralLimitless printing Pin
Member 1419221622-Jun-21 1:21
MemberMember 1419221622-Jun-21 1:21 

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.