Autor Beitrag
mindhunter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Di 19.10.21 13:18 
Hallo,

ich versuche leider erfolglos ein WPF (xaml) mit Register anzulegen. Bestimmt habt ihr eine einfache Lösung für mein Problem. Ich möchte einfach 3 Register in einem WPF mit TextBoxen, Datagrid und Kombination aus beidem.

Gruß Stefan

Moderiert von user profile iconTh69: Titel geändert (war "Tabs in WPF mit Textboxen").
Einloggen, um Attachments anzusehen!
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Di 19.10.21 14:18 
Ja, dafür gibt es das TabControl.
Was ist deine eigentliche Frage?
mindhunter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Di 19.10.21 14:38 
Wie bekomme ich in die xaml die TextBoxen in Tab "Insert" und ein Datagrid in Tab "Scd"? Dazu noch Schaltflächen, wie auf dem Bild zu sehen.

ausblenden XML-Daten
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
<Window x:Class="WpfApp1.Window3"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        mc:Ignorable="d"
        Title="Window3" Height="450" Width="800">
    <Grid>
        <Grid>
            <TabControl>
                <TabItem Header="Insert">
                    <Label Content="Content goes here..." />
                </TabItem>
                <TabItem Header="Scd" />
                <TabItem Header="Admin" />
            </TabControl>
        </Grid>
    </Grid>
</Window>


Moderiert von user profile iconTh69: Vollzitat entfernt.
Moderiert von user profile iconTh69: C#- durch XML-Tags ersetzt
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Di 19.10.21 15:15 
Dafür mußt du dann entsprechende Container-Controls benutzen, s. Übersicht über Panel-Elemente und Visual C# 2012: WPF-Layout-Container.
Für die freie Positionierung müßtest du ein Canvas benutzen - ich würde dir jedoch empfehlen (gerade im Hinblick auf Skalierung), eine Kombination (d.h. Schachtelung) von Grid, DockPanel und StackPanel zu benutzen.
mindhunter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mi 20.10.21 14:16 
Habt ihr ein anwendbares Beispiel?
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mi 20.10.21 14:44 
Da gibt es doch dieses "Internet"...

Schau mal in Tab Control In WPF (XAML-Code und Bild zum letzten Tab "Contact Us").

Ansonsten erstelle doch einfach die TabItems per Designer.