How do i rotate the textlabels in menubar so they will be vertical?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1922 Views - Last Post: 08 July 2012 - 06:06 PM Rate Topic: -----

#1 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 02:30 PM

Hello.

How do i rotate the textlabels in menubar so they will be vertical?
I want the textlabels to be verticals. Now they are horrizontals.
Do you know how to do?

Here is a screenshot of my program:
Posted Image

Im gonna make a webbrowser who works like it rotate the picture so it lay down.
Do you know how to do that too?

Is This A Good Question/Topic? 0
  • +

Replies To: How do i rotate the textlabels in menubar so they will be vertical?

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 02:35 PM

If this is WinForms you're boned.
If it is WPF you can do that.


<TextBlock FontSize="14"
            FontWeight="Bold"
            Text="Details">
    <TextBlock.LayoutTransform>
        <RotateTransform Angle="0" />
    </TextBlock.LayoutTransform>
</TextBlock>


Was This Post Helpful? 0
  • +
  • -

#3 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 02:41 PM

View PosttlhIn`toq, on 08 July 2012 - 02:35 PM, said:

If this is WinForms you're boned.
If it is WPF you can do that.


<TextBlock FontSize="14"
            FontWeight="Bold"
            Text="Details">
    <TextBlock.LayoutTransform>
        <RotateTransform Angle="0" />
    </TextBlock.LayoutTransform>
</TextBlock>



I did just use the standard application in MS C#.net.
I don't know what you're meaning with WPF?
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 02:50 PM

WinForms has been the standard Windows GUI style for years.
It has a solid base and history. But it is also locked into the paradigm of coding developed in the 1980-1990's.

WPF (Windows Presentation Foundation) is the new way to make GUI applications. It uses the XAML markup language for the GUI and C# for the code behind. It is the direction MS is steering developers.

XAML is also the basis for Silverlight applications and (I think) the basis for new Windows8 metro applications.

Since all of this is equally new to you, it would make a LOT of sense for you to just jump into WPF and not worry about WinForms unless you have a specific need.

In other words, if the price were the same would you rather have a new 2013 Dodge Ram, or a 1990 Dodge Ram?

This post has been edited by tlhIn`toq: 08 July 2012 - 02:51 PM

Was This Post Helpful? 0
  • +
  • -

#5 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 03:18 PM

View PosttlhIn`toq, on 08 July 2012 - 02:50 PM, said:

WinForms has been the standard Windows GUI style for years.
It has a solid base and history. But it is also locked into the paradigm of coding developed in the 1980-1990's.

WPF (Windows Presentation Foundation) is the new way to make GUI applications. It uses the XAML markup language for the GUI and C# for the code behind. It is the direction MS is steering developers.

XAML is also the basis for Silverlight applications and (I think) the basis for new Windows8 metro applications.

Since all of this is equally new to you, it would make a LOT of sense for you to just jump into WPF and not worry about WinForms unless you have a specific need.

In other words, if the price were the same would you rather have a new 2013 Dodge Ram, or a 1990 Dodge Ram?


So i can rotate the textlabels in my program? :)
I would take the Dodge Ram 2013. But if you say Mercedes and Cadillac, i would choose the Cadillac directly!

But where can i find the file who have the properties of this style of code:
<TextBlock FontSize="14"

            FontWeight="Bold"

            Text="Details">

    <TextBlock.LayoutTransform>

        <RotateTransform Angle="0" />

    </TextBlock.LayoutTransform>

</TextBlock>


Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 03:26 PM

View Postpersson121, on 08 July 2012 - 04:18 PM, said:

So i can rotate the textlabels in my program? :)

But where can i find the file who have the properties of this style of code:


Yes you can, if you build this as a WPF application and not WinForms.

Attached Image
Was This Post Helpful? 0
  • +
  • -

#7 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 03:36 PM

View PosttlhIn`toq, on 08 July 2012 - 03:26 PM, said:

View Postpersson121, on 08 July 2012 - 04:18 PM, said:

So i can rotate the textlabels in my program? :)

But where can i find the file who have the properties of this style of code:


Yes you can, if you build this as a WPF application and not WinForms.

Attachment wpf.jpg


Well.....I've to start over agin...
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 03:44 PM

Consider that a good thing. Building is how we get good at what we do.

Since you are only changing the GUI, all of the work spending on building pure object classes should carry over without much change.

So if you already built classes for RangeObject, IndicatorObject, MMAobject and so on all of that isn't lost.
Was This Post Helpful? 0
  • +
  • -

#9 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 04:04 PM

But how do I add tags to the menu?
I've created the menu and the form.

But i can't create the tags to the menu.

Posted Image
Was This Post Helpful? 0
  • +
  • -

#10 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 04:52 PM

I don't realy know how to delete the post above this one. I've found a way to create tabs in the menubar, but not how to set so the labels will be verticals.
Was This Post Helpful? 0
  • +
  • -

#11 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 04:54 PM

Do you mean MenuItems? The items in the menu:
File | Edit | Windows | Help

You really shouldn't just bang on the keyboard and hope you can reverse engineer how XAML works.

Do a few WPF tutorials.

Nobody here is going to hand-hold you through each every

Q: How do I...
A: xxxx
Q: How do I...
A: xxx
Q: How do I...
A: xxx

when there are so many tutorials as well as the MSDN describing how to use each part.


But here's the short explanation of XAML:
for everyone opening tag you have a closing tag.
You put other stuff in between.

<somekindoftag>
  <somethingelse>
     <widget>
     <widget>
  </somethingelse>
</somekindoftag>


Here is a start on a menu to get you in the right direction.
It will create a File menu with a few MenuItems that have icons, text and ToolTips


        <Menu Margin="0,0,0,0"
              DockPanel.Dock="Top"
              IsMainMenu="True">
            <Menu.ItemsPanel>
                <ItemsPanelTemplate>
                    <DockPanel HorizontalAlignment="Stretch" />
                </ItemsPanelTemplate>
            </Menu.ItemsPanel>

            <MenuItem Name="menuItemFile"
                      Grid.IsSharedSizeScope="True"
                      Header="_File">
 


                <MenuItem Name="menuItemOpen"
                          Command="ApplicationCommands.Open"
                          Header="_Open"
                          Visibility="Collapsed">
                    <MenuItem.Icon>
                        <Image Width="20"
                               Height="20"
                               Source="MenuArt\document-open.png" />
                    </MenuItem.Icon>
                    <MenuItem.ToolTip>
                        <ToolTip>Cut the selection.</ToolTip>
                    </MenuItem.ToolTip>
                </MenuItem>

                <MenuItem Name="menuItemClose"
                          Command="ApplicationCommands.Close"
                          Header="_Close"
                          Visibility="Collapsed">
                    <MenuItem.Icon>
                        <Image Width="20"
                               Height="20"
                               Source="MenuArt\process-stop.png" />
                    </MenuItem.Icon>
                    <MenuItem.ToolTip>
                        <ToolTip>Cut the selection.</ToolTip>
                    </MenuItem.ToolTip>
                </MenuItem>

                <MenuItem Name="menuItemPrint"
                          Command="ApplicationCommands.Print"
                          Header="_Print"
                          Visibility="Collapsed">
                    <MenuItem.Icon>
                        <Image Width="20"
                               Height="20"
                               Source="MenuArt\document-print.png" />
                    </MenuItem.Icon>
                    <MenuItem.ToolTip>
                        <ToolTip>Cut the selection.</ToolTip>
                    </MenuItem.ToolTip>
                </MenuItem>

                <Separator />


Was This Post Helpful? 0
  • +
  • -

#12 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 05:20 PM

Im new to WPF, but im searching mutch on youtube for tut's.

But my code dosen't look like your code.
Have a look at my code when i press a tab in a menu.

<Window x:Class="Plattform.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Plattform" Height="350" Width="525" DataContext="{Binding}">
    <Grid>
        <Menu HorizontalAlignment="Right" Name="menu1" VerticalAlignment="Stretch" Width="74" RenderTransformOrigin="0,0">
            <MenuItem Header="Range" Click="MenuItem_Click" HorizontalContentAlignment="Left" VerticalContentAlignment="Stretch" RenderTransformOrigin="0,0" FontStretch="Normal">
                <MenuItem Header="Days" />
                <MenuItem Header="Month" />
                <MenuItem Header="Years" />
            </MenuItem>
            <MenuItem Header="Type">
                <MenuItem Header="Bar" />
                <MenuItem Header="Line" />
                <MenuItem Header="Candlestick" />
            </MenuItem>
            <MenuItem Header="Scale">
                <MenuItem Header="Log" />
                <MenuItem Header="Linear" />
            </MenuItem>
            <MenuItem Header="Size">
                <MenuItem Header="M" />
                <MenuItem Header="L" />
            </MenuItem>
            <MenuItem Header="SMA">
                <MenuItem Header="Enter SMA value" />
            </MenuItem>
            <MenuItem Header="EMA">
                <MenuItem Header="Enter EMA value" />
            </MenuItem>
            <MenuItem Header="Indicators">
                <MenuItem Header="MACD" />
                <MenuItem Header="MFI" />
                <MenuItem Header="ROC" />
                <MenuItem Header="RSI" />
                <MenuItem Header="Slow Stoch" />
                <MenuItem Header="Fast Stoch" />
                <MenuItem Header="Vol" />
                <MenuItem Header="Vol+MA" />
                <MenuItem Header="W%R" />
            </MenuItem>
            <MenuItem Header="Overlays">
                <MenuItem Header="Bollinger Bands" />
                <MenuItem Header="Parabolic SAR" />
                <MenuItem Header="Splits" />
                <MenuItem Header="Volume" />
            </MenuItem>
            <MenuItem Header="Company">
                <MenuItem Header="Add/Delete company" />
                <MenuItem Header="Next" />
                <MenuItem Header="Past" />
                <MenuItem Header="Compare with..." />
            </MenuItem>
            <MenuItem Header="Read me">
                <MenuItem Header="About Plattfrom" />
                <MenuItem Header="About me" />
            </MenuItem>
            <MenuItem Header="Chat">
                <MenuItem Header="Enter IRC chat" />
            </MenuItem>
            <MenuItem Header="Quit" Click="MenuItem_Click_1">
                <MenuItem Header="Exit" DataContext="{Binding}" />
            </MenuItem>
        </Menu>
    </Grid>
</Window>



Was This Post Helpful? 0
  • +
  • -

#13 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 05:32 PM

<MenuItem Header="Years" />

is the short form of

<MenuItem Header="Years">

</MenuItem>


the ending /> is used in XML when there is no content between the opening and closing tags.

This is how most tags look by default when you just drag/drop objects from the toolbox.

You can edit the XAML just like you do C# and make it what you want.

What you have here looks like you are enamored with drag-n-drop but not really building a program: Just playing with IDE like it was a paint program. You seem more concerned with having something to look at than having something with functionality.

Let me suggest you not get carried away with dragging out a bunch of things that don't really do anything. Just make 1 thing: 1 menu with 1 subitem. Then make it work and make it what you want. Get it to look right, include an icon you want, respond to a click event, have a name so you can reference it in the C# code behind, bind it's value to a property in your C#, etc.

Once you have one MenuItem complete and right and working, you can then select all of its XAML code and copy/paste it in the XAML code editor to make another one. Then change the items you need to, like the text shown and the value its binded to.
Was This Post Helpful? 0
  • +
  • -

#14 persson121   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 30-June 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 05:50 PM

I thought it was a "button" that I could write or twist so the label in the menubare changing to a vertical one.
Yes, i like to "drag and drop", but im new to WPF and I'm not as comfortable as I am in the normal app-chooser.

So i need to write by my own? No button, just write in the XALM code?

This post has been edited by tlhIn`toq: 09 July 2012 - 08:16 AM
Reason for edit:: No need to quote the entire previous message: We can all see it

Was This Post Helpful? 0
  • +
  • -

#15 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7453
  • View blog
  • Posts: 25,095
  • Joined: 05-May 12

Re: How do i rotate the textlabels in menubar so they will be vertical?

Posted 08 July 2012 - 06:02 PM

You'll find you have more control writing the XAML directly. Yes, initially it is tempting to drag n' drop, but for the fine tuning, it's better to edit the XAML.

If you really are a visual editor type person, I recommend using Blend instead of Visual Studio to build your UI. This is one of the nice things about WPF. It tries to break the View from the data (aka Model) and the code (aka Controller). In theory, a graphic designer can work on the View independently from the architect who is working on the Model while the developer is working on the Controller. In practice, from what I've seen so far, it's only been the View that can be edited independently. There is still too much coupling between the Model and the Controller.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2