Hello,

Je me suis lancé il y a quelques heures dans WPF, ceci pour tirer avantage de son interface plutôt jolie en comparaison des composants plus classique.

Mon problème est le suivant: selon le compilateur il manque une méthode:

Error 1 'WpfApplication1.Window1' does not contain a definition for 'Window_Loaded' and no extension method 'Window_Loaded' accepting a first argument of type 'WpfApplication1.Window1' could be found (are you missing a using directive or an assembly reference?)
Le morceau en gras de ce code est pointé:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Personnal tools for work" Height="708" Width="1192" Loaded="Window_Loaded" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration">
Et je n'ai strictement aucune idée de comment c'est arrivé là dedans puisqu'avant que je commence à mettre des onglets, tout marchait bien :s

Voici le code en entier de ma page:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Personnal tools for work" Height="708" Width="1192" Loaded="Window_Loaded" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration">
 
    <TabControl>
        <TabItem Header="Field Finder" Name="tbItemFieldFinder">
            <Grid Name="grdFieldFinder">
                <Menu VerticalAlignment="Top">
                    <MenuItem Name="menuItemExit" Header="Exit" />
                    <MenuItem Name="menuItemHelp" Header="Help">
                        <MenuItem Name="menuItemDsplyHelp" Header="Help"/>
                        <MenuItem Name="menuItemAboutUs" Header="About us"/>
                    </MenuItem>
                </Menu>
                <ListBox HorizontalAlignment="Left" Margin="12,95,0,60" Name="lstBxTables" Width="162" />
                <Button Height="34" HorizontalAlignment="Left" Margin="12,0,0,12" Name="btnGetCommonFields" VerticalAlignment="Bottom" Width="162">Get common fields</Button>
                <Label Height="62" HorizontalAlignment="Left" Margin="12,27,0,0" Name="lblDesc" VerticalAlignment="Top" Width="162" IsTabStop="False" FlowDirection="LeftToRight">
                    <Label.ContextMenu>
                        <ContextMenu />
                    </Label.ContextMenu> Select table in which you wish to find common fields (press ctrl + left click for multi selection)
                </Label>
                <Grid Margin="180,95,12,60" Name="grid1" />
                <Button Height="34" HorizontalAlignment="Right" Margin="0,0,12,12" Name="btnExportToExcel" VerticalAlignment="Bottom" Width="112">Export to excel</Button>
                <Button Height="34" HorizontalAlignment="Left" Margin="918,0,0,12" Name="btnCreateSqlQuery" VerticalAlignment="Bottom" Width="112">Create SQL Query</Button>
                <Label Height="28" HorizontalAlignment="Left" Margin="239,61,0,0" Name="label1" VerticalAlignment="Top" Width="120">Filter by colomn:</Label>
                <ComboBox Height="23" HorizontalAlignment="Left" Margin="338,65,0,0" Name="comboBox1" VerticalAlignment="Top" Width="184" />
                <Label Height="28" Margin="0,61,450,0" Name="label2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="89">Filter by field:</Label>
                <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,66,260,0" Name="comboBox2" VerticalAlignment="Top" Width="196" />
            </Grid>
        </TabItem>
        <TabItem Header="Time Manager" Name="tbItemTimeManager">
            <Grid Height="Auto" Name="grdTimeManager" Width="Auto" HorizontalAlignment="Stretch">
                <Frame HorizontalAlignment="Left" Margin="6,6,0,6" Name="frame1" Width="218" />
            </Grid>
        </TabItem>
    </TabControl>
 
</Window>
Merci d'avance pour votre aide

L.