- Kivenné a részét az új HBM memóriák tokozásából az LG
- Az ASUS legfrissebb analóg billentyűzete az ízületeinket is kímélni szeretné
- A Team Group SSD-je gondoskodik arról, hogy az utolsó bitig letörölhető legyen
- Maximum 320 Hz-et képes magából kipréselni a Philips dual mode-os monitora
- A TSMC gyárthatja a Nova Lake legfontosabb komponensét
Új hozzászólás Aktív témák
-
trisztan94
őstag
Egy ténylegesen C# kérdés most:
XAML-ben a definiált GRID ahogyan észrevettem egyáltalán nem úgy működik, mint a Windows Forms-os.
3 sorban van összesen 12 gomb, random gomboknak szeretném a Content attribútumát változtatni, de sehogyan sem tudok rá hivatkozni..
<Grid x:Name="buttons_container" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="70"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Grid x:Name="buttons_first_row" Grid.Row="0" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
<Grid x:Name="buttons_second_row" Grid.Row="1" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
<Grid x:Name="buttons_third_row" Grid.Row="2" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
</Grid>InterfaceDesigner-en próálható.
Tehát az a lényeg, hogy két random számom van: x és y. Az x az oszlopokat, az y a sorokat jelöli.
Ha pl. a 3-mat dob ki, akkor a 3. sor x. elemét szeretném módosítani.
Próbáltam így C#-ban:
buttons_first_row.Children.ElementAt(2)...ez szépen meg is találja a nekem kellő button-t (jelen esetben az első sor 3.), de módosítani sehogy sem tudom, ugyanis nincs .Content tulajdonsága a System.Windows.UIElement-nek.
Hogyan tudnám ezt szépen megoldani? Adjak minden gombnak egyedi nevet, aztán egy baromi nagy switch elágazással jelöljem ki őket?
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Akciókamerák
- Három új órát hozott a Samsung, a csúcson az Ultra
- Assetto Corsa Competizione
- Opel topik
- Nintendo 3DS és DS topic
- Luck Dragon: Asszociációs játék. :)
- Gitáros topic
- Spórolós topik
- One otthoni szolgáltatások (TV, internet, telefon)
- További aktív témák...
- Dell D6000 univerzális dokkoló USB-C/ USB-A, DisplayLink & Dell WD15 (K17A) USB-C + 130-180W töltő
- Bomba ár! Dell Latitude 7390 2in1 - i7-8G I 16GB I 256SSD I 13,3"FHD Touch I HDMI I Cam I W11 I Gar
- Apple Watch SE 2 44mm, Újszerű, 1 Év Garanciával
- Apple iPhone 13 128GB / Kártyafüggetlen 1ÉV GARANCIÁVAL
- BESZÁMÍTÁS! GIGABYTE AORUS ELITE Z790 i7 14700K 64GB DDR5 1TB SSD 7900XTX 24GB be quiet! SB802 1000W
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest