Click here to Skip to main content
15,889,863 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Can i change the shape of the button as its background image? Pin
CoderForEver14-Sep-09 22:06
CoderForEver14-Sep-09 22:06 
GeneralRe: Can i change the shape of the button as its background image? Pin
Henry Minute16-Sep-09 2:41
Henry Minute16-Sep-09 2:41 
GeneralRe: Can i change the shape of the button as its background image? Pin
Richard MacCutchan17-Sep-09 4:41
mveRichard MacCutchan17-Sep-09 4:41 
QuestionOverride Text property in GroupBox Pin
dybs11-Sep-09 19:05
dybs11-Sep-09 19:05 
AnswerRe: Override Text property in GroupBox Pin
geali_dor12-Sep-09 0:36
geali_dor12-Sep-09 0:36 
GeneralRe: Override Text property in GroupBox Pin
dybs12-Sep-09 4:54
dybs12-Sep-09 4:54 
AnswerRe: Override Text property in GroupBox Pin
Henry Minute12-Sep-09 5:47
Henry Minute12-Sep-09 5:47 
GeneralRe: Override Text property in GroupBox Pin
dybs13-Sep-09 14:04
dybs13-Sep-09 14:04 
Henry,

Thanks for the links, but the article's aren't quite what I'm after. What I'm trying to make is a GroupBox that will expand/collapse when a header is clicked. In my case I'm using a ToolStrip at the top of the GroupBox, and I want the ToolStrip's label to show the Text property instead of the GroupBox. Rather than inherit from UserControl and do everything by hand, it seemed reasonable to inherit from GroupBox and just override the Text property, and add the expand/collapse behavior.

I've almost got it working now. I tried using new instead of override for the Text property, and it gives me the desired effect, but the value I set in the designer doesn't show up when the application run. It only shows me the default value. It's the same situation described here[^]. The value is not being written to the InitializeComponent method for my form. I tried setting the DesignerSerializationVisibility attribute to Visible, but that didn't work. I've looked at the other attributes listed on MSDN[^], but I don't see any others that I know would help. Here's what my code looks like now:

public partial class ExpandableGroupBox : GroupBox
{
    public ExpandableGroupBox()
    {
        InitializeComponent();
        base.Text = "";
    }

    [EditorBrowsable(EditorBrowsableState.Always), Browsable(true),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
    Bindable(true)]
    public new string Text
    {
        get
        {
            return toolStripLabel1.Text;
        }
        set
        {
            toolStripLabel1.Text = value;
        }
    }
}


After some more searching, it looks like I may be able to use something like DevExpress's XtraNavBar[^]. However, I'd still like to figure this out just for my own curiosity. Things like this bug me to no end... Poke tongue | ;-P


Any more help would be greatly appreciated.

Dybs
GeneralRe: Override Text property in GroupBox Pin
Henry Minute13-Sep-09 14:17
Henry Minute13-Sep-09 14:17 
GeneralRe: Override Text property in GroupBox Pin
dybs13-Sep-09 16:00
dybs13-Sep-09 16:00 
GeneralRe: Override Text property in GroupBox Pin
dybs18-Sep-09 6:44
dybs18-Sep-09 6:44 
GeneralRe: Override Text property in GroupBox Pin
Henry Minute18-Sep-09 6:48
Henry Minute18-Sep-09 6:48 
QuestionMyNeoReports Pin
CWogksch11-Sep-09 4:31
CWogksch11-Sep-09 4:31 
AnswerRe: MyNeoReports Pin
Henry Minute12-Sep-09 5:49
Henry Minute12-Sep-09 5:49 
QuestionFlickering Problem [modified] Pin
geali_dor10-Sep-09 22:21
geali_dor10-Sep-09 22:21 
AnswerRe: Flickering Problem Pin
Henry Minute12-Sep-09 5:51
Henry Minute12-Sep-09 5:51 
AnswerRe: Flickering Problem Pin
April Fans21-Sep-09 21:46
April Fans21-Sep-09 21:46 
QuestionChange Background image of form runtime Pin
swapnil_bhanagle10-Sep-09 6:15
swapnil_bhanagle10-Sep-09 6:15 
AnswerRe: Change Background image of form runtime Pin
dan!sh 11-Sep-09 6:33
professional dan!sh 11-Sep-09 6:33 
AnswerRe: Change Background image of form runtime Pin
April Fans21-Sep-09 21:44
April Fans21-Sep-09 21:44 
Questionlogical expression editor Pin
r.ps9-Sep-09 19:00
r.ps9-Sep-09 19:00 
QuestionDifferent Icon on the title bar than on the application tab Pin
andy4009-Sep-09 10:50
andy4009-Sep-09 10:50 
AnswerRe: Different Icon on the title bar than on the application tab Pin
Luc Pattyn9-Sep-09 10:57
sitebuilderLuc Pattyn9-Sep-09 10:57 
GeneralRe: Different Icon on the title bar than on the application tab Pin
andy4009-Sep-09 11:24
andy4009-Sep-09 11:24 
GeneralRe: Different Icon on the title bar than on the application tab Pin
Luc Pattyn9-Sep-09 11:32
sitebuilderLuc Pattyn9-Sep-09 11:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.