Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I'm creating a simple window in WPF which will be composed of two tabs. Every tab will contain a canvas where I'll put all other objects (labels, comboboxes, radio buttons, etc.). The first tab design went smooth, but I'm having problems with the others. When I drag&drop ojects from Toolbox to the design window, once dropped, I can't change their position by mouse, but only manually setting layout values in Property window. I'm using Visual Studio 2012.
 
A solution may be:
- I fully design the 1st tabItem
- I copy it into another document
- I delete it from the original project and start creating the 2nd
- At the end, I copy\paste all previous tabItem into the original project
 
I'm fully confident in the existence of a smarter solution Smile | :)
 
Here a short recap of the code:
<TabControl>
        <TabItem Header="General">
            <Canvas x:Name="General" HorizontalAlignment="Left" Height="444" VerticalAlignment="Top" Width="486">
              <Label Content="1st label" Canvas.Left="3" Canvas.Top="123"/>
              <Label Content="2nd label" Canvas.Top="149" RenderTransformOrigin="-0.225,0.365" Canvas.Left="3"/>
            </Canvas>
        </TabItem>
 
        <TabItem Header="Arpeggio">
            <Canvas x:Name="Arpeggio" Width="486" Height="444" HorizontalAlignment="Left" VerticalAlignment="Top">
                
              <Label Content="Label" Canvas.Left="46" Canvas.Top="71" Width="43" />
              <Button Content="Button" Canvas.Left="69" Canvas.Top="100" Width="75" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.48,0.364"/>
            </Canvas>
        </TabItem>
</TabControl>
Posted 30-Jan-13 5:49am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150302.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100