- forum
- PowerShell
- Entraide pour les initiés
- Powershell - Selection d'un <Grid par ces positions (Row et Col)
Question Powershell - Selection d'un <Grid par ces positions (Row et Col)
- Bruno95
- Auteur du sujet
- Hors Ligne
- Membre senior
Réduire
Plus d'informations
- Messages : 72
- Remerciements reçus 2
il y a 2 mois 3 semaines - il y a 2 mois 3 semaines #34486
par Bruno95
Bonjour,
J'aimerai selectionner un <Grid par ces positions Row et Col et changer sa propriete Background..
XAML:
<Grid Name="PlayerGrid" ShowGridLines="True" Width="720" Height="720">
<Grid.RowDefinitions>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="1" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="2" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="3" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="4" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="5" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="6" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="7" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="8" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="9" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="10" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="11" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="12" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="13" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="14" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="1" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="2" Background="Black"></Grid>
Etc.....
POWERSHELL:
#Selection grille Player dans .xaml
$PlayerGrid = $Form.FindName("PlayerGrid")
#Selection des 225 cases de la grille (15x15)
$PlayerGrid = $PlayerGrid.Children
#Affichage
$PlayerGrid
#Malheureusement, aucune des nombreuses "proprietes" affichées, ne parle de Grid.Row="0" Grid.Column="0", ce qui est surement normal
#Selection <Grid $Row/$Col sur $PlayerGrid
............
#Changement de la propriete Background (en Gray)
......................
Voila, cela me parait faisable, j'espere ne pas me tromper
Merci d'avance pour vos reponses et bon dimanche.
Bruno.
J'aimerai selectionner un <Grid par ces positions Row et Col et changer sa propriete Background..
XAML:
<Grid Name="PlayerGrid" ShowGridLines="True" Width="720" Height="720">
<Grid.RowDefinitions>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
<RowDefinition Height="*"/><RowDefinition Height="*"/><RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="1" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="2" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="3" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="4" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="5" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="6" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="7" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="8" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="9" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="10" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="11" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="12" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="13" Background="Black"></Grid>
<Grid Grid.Row="0" Grid.Column="14" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="1" Background="Black"></Grid>
<Grid Grid.Row="1" Grid.Column="2" Background="Black"></Grid>
Etc.....
POWERSHELL:
#Selection grille Player dans .xaml
$PlayerGrid = $Form.FindName("PlayerGrid")
#Selection des 225 cases de la grille (15x15)
$PlayerGrid = $PlayerGrid.Children
#Affichage
$PlayerGrid
#Malheureusement, aucune des nombreuses "proprietes" affichées, ne parle de Grid.Row="0" Grid.Column="0", ce qui est surement normal
#Selection <Grid $Row/$Col sur $PlayerGrid
............
#Changement de la propriete Background (en Gray)
......................
Voila, cela me parait faisable, j'espere ne pas me tromper
Merci d'avance pour vos reponses et bon dimanche.
Bruno.
Dernière édition: il y a 2 mois 3 semaines par Bruno95.
Connexion ou Créer un compte pour participer à la conversation.
- forum
- PowerShell
- Entraide pour les initiés
- Powershell - Selection d'un <Grid par ces positions (Row et Col)
Temps de génération de la page : 0.092 secondes
- Vous êtes ici :
- Accueil
- forum
- PowerShell
- Entraide pour les initiés
- Powershell - Selection d'un <Grid par ces positions (Row et Col)