Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Chris_McGrath

@Chris_McGrath
About
Posts
10
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# 4.0
    C Chris_McGrath

    I'd like to see them fix automatic properties. A lot of people have complained that there should be a way to set the default like... public int A { get; set; default { return 1; } But i think they should take it further. I'm a big fan of the CSLA framework hence i have a lot of properties following

        public int A
        {
            get
            {
                CanReadProperty(PropertyNames.A, true);
                return m\_a;
            }
            set
            {
                CanWriteProperty(PropertyNames.A, true);
                if (!m\_a.Equals(value))
                {
                    m\_a = value;
                    PropertyHasChanged(PropertyNames.A);
                }
            }
        }
    

    (I know new CSLA is different but it's still just as much repetition) I would love to be able to say

    public int A { get; set; from CslaProperty }

    where CslaProperty is a template. It's sort of like adding inheritance to Properties. I'd also like to be able to take it further so you could say...

    public string A
    {
        get;
        set
        {
            if (value == null)
                value = "";
            @templateBase = value;
        }
    }
    

    This would stop the really annoying thing about automatic properties where you use them, then you want to make a minor change and have to go to the trouble of making a full property

    The Lounge csharp question discussion announcement

  • UITypeEditor problem - Get calling assembly
    C Chris_McGrath

    Just a quick overview, I have controls which have a property of Type Type. The property grid doesn't by default support editing of it. So I have to inherit from UITypeEditor. What my program currently does is display a form with all the types in the assembly my UITypeEditor is in and all the assemblies it references. This is not quite ideal because it should be the assembly the Form (or other control) that is being designed is in and all of it's references. Any ideas? Thanks in advance, Chris

    C# css help question

  • Windows API double click
    C Chris_McGrath

    Hi, I'm trying to fire an event when a NativeWindow is double-clicked. I am not inheriting from it so i can't use the WndProc. I can of course easily get the Handle. Does anyone know anything in the Windows API which I can use to detect a double click? Thanks, Chris

    Windows Forms json question learning

  • Detect Shift when Menu Opens
    C Chris_McGrath

    Figured it out - ModifierKeys == Keys.Shift

    C# tutorial question

  • Detect Shift when Menu Opens
    C Chris_McGrath

    Hi, For those who don't know, in Windows Vista when you hold shift down and right click a folder a few hidden options (Copy as Path, Command Wind Here) I was wanting to implement a similar feature in my program - mainly for debugging purposes. For example on my grids when you right click on the Header it displays all column names and lets you show and hide them. I would like it so if shift was pressed it would put the width of the column after it. Any ideas?

    C# tutorial question

  • Hiding unwanted properties [modified]
    C Chris_McGrath

    I have a Control and a Form. The Form is a member of the Control. I exposed the form on the Control using a get property... class MyWindow : Form { ....public int MyProp ....{ ........get... set... ....} } class MyControl : Control { ....public MyWindow Window ....{ ........get... set... ....} } This of course shows up in the property Window of the Control and has all the Form properties and my properties. I however don't want to see any of the Form properties, only the Window ones. So I decided to write an interface... interface Window : IComponent { ....int MyProp ....{ ........get; set; ....} } class MyWindow : Form, Window { ... } class MyControl : Control { ....public Window Window ....{ ........get... set... ....} } I found out the interface will not show up in the designer if it doesn't inherit from IComponent. However, even when I do this all of the Form properties are still shown. Does anyone know how to fix this? At the moment I have settled for pass-through properties on my Control. (And I don't want to override evey method add the Browsable(false) attribute to each one Thanks, Chris McGrath -- modified at 21:04 Thursday 12th April, 2007

    C# help tutorial question learning

  • Inherited default values
    C Chris_McGrath

    My MainToolbar contains a ToolStrip which has the buttons on it, the buttons already default to true, so my properties look like [Browsable(true), Category("Icons Visible"), DefaultValue(true)] public virtual bool FirstShown { get { return btnFirst.Visible; } set { btnFirst.Visible = value; } } As I said it works perfectly if I place it on a form. The problem is when I inherit from the form which it is on, the Default Value Actually changes from false to true. So if I change FirstShown to false, it looses its boldness, doesn't write the line in the designer file, and when it builds it puts the value back to true. Thanks, Chris

    C# csharp visual-studio help tutorial question

  • Inherited default values
    C Chris_McGrath

    Ok, I'm having a few problems with designer in Visual Studio... I have a MainToolbar class which has buttons on it (e.g. Forward, Back). The buttons are private but they're exposed publicly via various Properties, e.g. ForwardShown, ForwardEnabled. These properties have 3 Attributes... [Browsable(true), Category("Icons Visible"), DefaultValue(true)] Now I place the MainToolbar on a Form called FormBaseEdit and it works well. The value for the properties like ForwardShown is true and NOT bold (as it should be). The MainToolbar is a protected member of FormBaseEdit. The problem comes when I then inherit from FormBaseEdit. The properties of the MainToolbar is still true However they are now BOLD. IF you change them to false they are not bold. Then when you build the project the properties that you changed to false are automatically back to true. Does anyone know how to stop this? Thanks, Chris McGrath

    C# csharp visual-studio help tutorial question

  • C# form caption
    C Chris_McGrath

    The problem with that is the form is then not resizable, in my current task I need it to be resizable, do you know how to get past this? Regards, Chris McGrath

    C# csharp help tutorial question

  • C# form caption
    C Chris_McGrath

    I am to remove the caption bar from a C# form (VS2005). I've set control box to false and removed the Text Field. The caption is gone but the problem is I can't put i title in the Taskbar. Does anyone know how to do this?

    C# csharp help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups