ragingben's Profile User Rating: -----

Reputation: 177 Stalwart
Group:
Authors
Active Posts:
650 (0.24 per day)
Joined:
07-October 08
Profile Views:
25,019
Last Active:
User is offline Jan 20 2016 07:16 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Nintendo
Your Car:
Who Cares
Dream Kudos:
250

Latest Visitors

Icon   ragingben has not set their status

Posts I've Made

  1. In Topic: WPF Dockpanel/Stackpanel Problem

    Posted 8 Jan 2016

    It's because the StackPanel is a child of the DockPanel, which is constrained to Row 0 Column 0, and the cumulative width of it's content exceeds the width of the column. The layout logic of the StackPanel knows nothing about wrapping, so when the contents exceeds the available width it just isn't rendered, but it is still loaded. With a WrapPanel the layout logic determines that the width of the content exceeds the width the panel is allowed to expand to horizontally, and so the content that overflows is wrapped.
  2. In Topic: WPF Dockpanel/Stackpanel Problem

    Posted 7 Jan 2016

    Hi Chris,

    If you want the content to wrap, try using WrapPanel rather than StackPanel.

    Without looking to deeply at it, the dock panel appeared to be acting strange. I usually wouldn't bother using DockPanel for the menu - I normally use a grid for the main area, which would have its content set to a grid with 3 rows - menu, main content and status. Then I would use an inner Grid, StackPanel, UserControl or whatever for the content. By removing the DockPanel and switching the StackPanel for a WrapPanel it does what you would wanted.
    <Window x:Class="Inventory_and_Locations.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            Title="MainWindow" Height="350" Width="525">
        <Grid Name="MainGrid">
            <Grid.RowDefinitions>
                <RowDefinition Name="MenuRow" Height="Auto"/>
                <RowDefinition Name="ContentRow" Height="*"/>
            </Grid.RowDefinitions>
            <Menu Background="White" Grid.Row="0">
                <MenuItem Header="_File">
                    <MenuItem Header="_Load"/>
                    <MenuItem Header="_Exit"/>
                </MenuItem>
                <MenuItem Header="_Parts">
                    <MenuItem Header="_Search Item"/>
                    <MenuItem Header="_Edit Item"/>
                    <MenuItem Header="_Delete Item" Click="MenuItem_onclick"/>
                </MenuItem>
            </Menu>
            <Grid Name="ContentGrid" ShowGridLines="True" Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                </Grid.ColumnDefinitions>
                <WrapPanel Orientation="Horizontal">
                    <TextBox Name="tbNameInput" Width="100" Height="20" FontSize="20" TextAlignment="Center"/>
                    <TextBlock Name="tbName" TextAlignment="Center" Width="100" Height="Auto" Text="Chris"/>
                    <TextBlock Name="tbColor" Background="Chocolate" Width="20" Text="Chocolate"/>
                </WrapPanel>
            </Grid>
        </Grid>
    </Window>
    
    
  3. In Topic: C# First program Hello world error?

    Posted 6 Jan 2016

    C# is a case sensitive language, with that in mind, take a look at the error message, it is essentially saying it can't find a method called 'Main'...
  4. In Topic: C# FileSystemWatcher The directory name Fonts is invalid.

    Posted 28 Nov 2014

    I would use a combination of the Environment.GetFolderPath() and Environment.SpecialFolder enum to get the font directory path:
    String fontsPath = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
    
  5. In Topic: Clarification on Static Classes

    Posted 28 Nov 2014

    I regularly use something similar in a system at work. I wrote a class library for controlling a robotics system. This has a Monitor class, that simply takes in routines the system can run, invokes them and monitors the feedback from them, alerting the user of any problems and initiating aborts, pauses etc if it picks up an error. It also allows the user to write data to it's feedback log with a WriteLine method similar to Console.WriteLine(). This data then enters a queue with a capacity of say 500, and this can be logged or whatever at any time, by any of the other projects that use it. It is really useful because then you can keep an application wide log of feedback from the different projects and do whatever you want with it. I have it so that each entry triggers an event if the user desires which allows me to display each feedback element in a terminal style window for the engineers.

    I think this is fine to do safely. Others may disagree, but I can't see any problem doing this at all.

My Information

Member Title:
D.I.C Addict
Age:
30 years old
Birthday:
May 11, 1985
Gender:
Location:
Somerset, England, Uk
Interests:
Playing football, punk rock, guitar, retro games, FX pedal building
Full Name:
Ben Pollard
Years Programming:
8
Programming Languages:
VB6, C#, WPF, MML, Flowcode, Python (a bit), GPProX for ProFace PLC's, CAN

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://www.0xdfx.wordpress.com
Twitter:
0xdfx

Friends

Showing 50 random friends of 13

Comments

Page 1 of 1
  1. Photo

    Frinavale Icon

    21 Sep 2011 - 09:22
    :)
  2. Photo

    Frinavale Icon

    20 Sep 2011 - 13:50
    ..I figuered if they phrased their question differently I could help...
  3. Photo

    Frinavale Icon

    20 Sep 2011 - 13:50
    The reason I posted my "useless" comment is to pull more information from the OP about the topic. I didn't realize how old the thread was. I simply started answering a few of the newest questions in the forum. I took the OP's code, and played with it: trying to envision what on earth they were trying to accomplish and couldn't. I figured if they phrased their question differ...
  4. Photo

    Frinavale Icon

    20 Sep 2011 - 13:50
    I'm not having a "hissy fit" I just found your comment a harsh and wanted you to be aware of it.
  5. Photo

    Frinavale Icon

    20 Sep 2011 - 06:52
    <sarcasm>Thank you very much for the wonderful "welcome to the forum" message you left me in thread. It's SOOO nice to be back trying to help people</sarcasm>
Page 1 of 1