A problem about the PropertyGrid. 
Author Message
 A problem about the PropertyGrid.

I created a propertygrid in one of my dll.

And I pass it as a "Control" to my main application.
It belongs to a panel in main application.

But when the form showing, the propertygrid had a little different:
all of it's head title and item's caption disappeared.
It had a terrible look.

Some of my code shown as follows:

public class DllTest
{
    PropertyGrid gridRight;
    ...........

    public override void CreateControl()
    {
       // Right
       gridRight = new System.Windows.Forms.PropertyGrid();
       gridRight.Location = new System.Drawing.Point(216, 0);

       // Create properties tab
       gridRight.CommandsVisibleIfAvailable = true;
       gridRight.LargeButtons = false;
       gridRight.LineColor = System.Drawing.SystemColors.ScrollBar;
       gridRight.Location = new System.Drawing.Point(16, 8);
       gridRight.Name = "propertyGrid1";
       gridRight.Size = new System.Drawing.Size(256, 248);
       gridRight.ViewBackColor = System.Drawing.SystemColors.Window;
       gridRight.ViewForeColor = System.Drawing.SystemColors.WindowText;

       gridRight.Text = "PropertyGrid";

       gridRight.Dock = System.Windows.Forms.DockStyle.Fill;
       gridRight.TabIndex = 1;

    }

    ............

    public override Control Right
    {
       get
       {
            return gridRight;
       }
    }

    ............

    private void treeViewLeft_Clicked(object sender, TreeViewCancelEventArgs
e)
    {
        if (null != e.Node.Tag)
            gridRight.SelectedObject = e.Node.Tag as BackupItem;
       else
            gridRight.SelectedObject = null;
    }

    ............

Quote:
}

public class MainApplication
{

  private void LoadClientComponents()
  {
   middleBar = new Splitter();
   middleBar.Dock = DockStyle.Left;
   panelRight.Controls.Add(middleBar);

   intee.Initialize();                    // intee is an instance of DllTest
and is created in another place.
   intee.CreateControl();
   left = intee.Left;
   panelRight.Controls.Add(intee.Left);
   right = intee.Right;
   panelRight.Controls.Add(intee.Right);
  }

Quote:
}

Thanks for your advice!


Tue, 07 Jun 2005 06:25:57 GMT  
 A problem about the PropertyGrid.
I have a mistake on it.

The caption is in the left edge, covered by other controls...



Quote:
> I created a propertygrid in one of my dll.

> And I pass it as a "Control" to my main application.
> It belongs to a panel in main application.

> But when the form showing, the propertygrid had a little different:
> all of it's head title and item's caption disappeared.
> It had a terrible look.

> Some of my code shown as follows:

> public class DllTest
> {
>     PropertyGrid gridRight;
>     ...........

>     public override void CreateControl()
>     {
>        // Right
>        gridRight = new System.Windows.Forms.PropertyGrid();
>        gridRight.Location = new System.Drawing.Point(216, 0);

>        // Create properties tab
>        gridRight.CommandsVisibleIfAvailable = true;
>        gridRight.LargeButtons = false;
>        gridRight.LineColor = System.Drawing.SystemColors.ScrollBar;
>        gridRight.Location = new System.Drawing.Point(16, 8);
>        gridRight.Name = "propertyGrid1";
>        gridRight.Size = new System.Drawing.Size(256, 248);
>        gridRight.ViewBackColor = System.Drawing.SystemColors.Window;
>        gridRight.ViewForeColor = System.Drawing.SystemColors.WindowText;

>        gridRight.Text = "PropertyGrid";

>        gridRight.Dock = System.Windows.Forms.DockStyle.Fill;
>        gridRight.TabIndex = 1;

>     }

>     ............

>     public override Control Right
>     {
>        get
>        {
>             return gridRight;
>        }
>     }

>     ............

>     private void treeViewLeft_Clicked(object sender,

TreeViewCancelEventArgs

- Show quoted text -

Quote:
> e)
>     {
>         if (null != e.Node.Tag)
>             gridRight.SelectedObject = e.Node.Tag as BackupItem;
>        else
>             gridRight.SelectedObject = null;
>     }

>     ............

> }

> public class MainApplication
> {

>   private void LoadClientComponents()
>   {
>    middleBar = new Splitter();
>    middleBar.Dock = DockStyle.Left;
>    panelRight.Controls.Add(middleBar);

>    intee.Initialize();                    // intee is an instance of
DllTest
> and is created in another place.
>    intee.CreateControl();
>    left = intee.Left;
>    panelRight.Controls.Add(intee.Left);
>    right = intee.Right;
>    panelRight.Controls.Add(intee.Right);
>   }
> }

> Thanks for your advice!



Tue, 07 Jun 2005 10:05:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Pleading for fresh eyes on my problem using a PropertyGrid with a Singleton

2. Populating a PropertyGrid using reflected types.

3. Automatic refreshing values in PropertyGrid

4. Resetting PropertyGrid value to old value

5. PropertyGrid and Managed C++

6. PropertyGrid and hiding properties

7. PropertyGrid DefaultValueAttribute

8. PropertyGrid DefaultValueAttribute

9. Adding property into PropertyGrid at runtime

10. How to Add My own Property Tab in the PropertyGrid for Button Control

11. propertygrid and mfc

12. PropertyGrid

 

 
Powered by phpBB® Forum Software