EinfachNurBaum
EinfachNurBaum
CC#
Created by EinfachNurBaum on 1/25/2024 in #help
WPF DataGrid
No description
6 replies
CC#
Created by EinfachNurBaum on 2/14/2023 in #help
❔ Item.Is a Number
Hey, I have this list:
{ "+", "-", "*", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
{ "+", "-", "*", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
I iterate through the list with a foreach. I want to check if the item is a number or not. So is there something like
foreach
if((int)item.Is a number)
.....
foreach
if((int)item.Is a number)
.....
?
14 replies
CC#
Created by EinfachNurBaum on 2/9/2023 in #help
❔ how to give the Label give better SetLeft() position
5 replies
CC#
Created by EinfachNurBaum on 2/4/2023 in #help
❔ WPF edit Label Content
Hey, I want to set the label on a random position. After this I want to edit the content of the label, buy how can I do that if my label are object or UIElement
foreach (var OR UIElement label in RememberScreen.Children)
if (typeof(Label).IsInstanceOfType(label))
{
while (true)
{
// increment i
i++;
// set position from left
posL ......
// set position from top
posT = .....
Debug.WriteLine(posL + " " + posT);

if (oldPosT.Contains(posT) != true)
{
label.Content = $"{i}"; // HERE IS THE ERROR
Canvas.SetLeft(labels[i], posL);
Canvas.SetTop(labels[i], posT);
label.Visibility = Visibility.Visible;
// add the position to the list
oldPosT.Add(posT);
Debug.WriteLine(oldPosT[i]);
break;
}
foreach (var OR UIElement label in RememberScreen.Children)
if (typeof(Label).IsInstanceOfType(label))
{
while (true)
{
// increment i
i++;
// set position from left
posL ......
// set position from top
posT = .....
Debug.WriteLine(posL + " " + posT);

if (oldPosT.Contains(posT) != true)
{
label.Content = $"{i}"; // HERE IS THE ERROR
Canvas.SetLeft(labels[i], posL);
Canvas.SetTop(labels[i], posT);
label.Visibility = Visibility.Visible;
// add the position to the list
oldPosT.Add(posT);
Debug.WriteLine(oldPosT[i]);
break;
}
Can I replace the label from my canvas with a new label than it's exactly the same with different content?
10 replies