1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
23 // Jonathan Chambers (jonathan.chambers@ansys.com)
30 using System.Collections;
31 using System.ComponentModel.Design;
33 using System.Drawing.Design;
34 using System.ComponentModel;
35 using System.Threading;
36 using System.Windows.Forms.Design;
38 namespace System.Windows.Forms.PropertyGridInternal {
39 internal class PropertyGridView : System.Windows.Forms.ScrollableControl, IWindowsFormsEditorService {
41 #region Private Members
42 private double splitter_percent = .5;
43 private const int V_INDENT = 16;
44 private int row_height;
45 private int font_height_padding = 3;
46 private const int RESIZE_WIDTH = 3;
47 private const int BUTTON_WIDTH = 25;
48 private PropertyGridTextBox grid_textbox;
49 private PropertyGrid property_grid;
50 private bool resizing_grid;
51 private int open_grid_item_count = -1;
52 private int skipped_grid_items;
53 private PropertyGridDropDown dropdown_form;
54 private Form dialog_form;
55 private ImplicitVScrollBar vbar;
56 private StringFormat string_format;
57 private Font bold_font;
61 public PropertyGridView (PropertyGrid propertyGrid) {
62 property_grid = propertyGrid;
64 property_grid.SelectedGridItemChanged+=new SelectedGridItemChangedEventHandler(HandleSelectedGridItemChanged);
65 property_grid.PropertyValueChanged+=new PropertyValueChangedEventHandler(HandlePropertyValueChanged);
67 string_format = new StringFormat();
68 string_format.FormatFlags = StringFormatFlags.NoWrap;
69 string_format.Trimming = StringTrimming.None;
71 grid_textbox = new PropertyGridTextBox();
72 grid_textbox.DropDownButtonClicked +=new EventHandler(DropDownButtonClicked);
73 grid_textbox.DialogButtonClicked +=new EventHandler(DialogButtonClicked);
76 dropdown_form = new PropertyGridDropDown();
77 dropdown_form.FormBorderStyle = FormBorderStyle.None;
78 dropdown_form.StartPosition = FormStartPosition.Manual;
79 dropdown_form.ShowInTaskbar = false;
81 dialog_form = new Form ();
82 dialog_form.StartPosition = FormStartPosition.Manual;
83 dialog_form.FormBorderStyle = FormBorderStyle.None;
84 dialog_form.ShowInTaskbar = false;
86 skipped_grid_items = 0;
87 row_height = Font.Height + font_height_padding;
89 grid_textbox.Visible = false;
90 grid_textbox.Font = this.Font;
91 grid_textbox.BackColor = this.BackColor;
92 // Not working at all, used to??
93 grid_textbox.Validating += new CancelEventHandler(TextBoxValidating);
94 grid_textbox.ToggleValue+=new EventHandler(grid_textbox_ToggleValue);
95 this.Controls.Add(grid_textbox);
97 vbar = new ImplicitVScrollBar();
99 vbar.ValueChanged+=new EventHandler(HandleValueChanged);
100 vbar.Dock = DockStyle.Right;
101 this.Controls.AddImplicit(vbar);
103 resizing_grid = false;
105 bold_font = new Font(this.Font, FontStyle.Bold);
107 ForeColorChanged+=new EventHandler(RedrawEvent);
108 BackColorChanged+=new System.EventHandler(RedrawEvent);
109 FontChanged+=new EventHandler(RedrawEvent);
110 SizeChanged+=new EventHandler(RedrawEvent);
112 SetStyle(ControlStyles.DoubleBuffer, true);
113 SetStyle(ControlStyles.UserPaint, true);
114 SetStyle(ControlStyles.AllPaintingInWmPaint, true);
115 SetStyle(ControlStyles.ResizeRedraw, false);
120 #region Protected Instance Methods
122 protected override void OnFontChanged(EventArgs e) {
123 bold_font = new Font(this.Font, FontStyle.Bold);
126 row_height = Font.Height + font_height_padding;
127 base.OnFontChanged (e);
130 protected override void OnDoubleClick(EventArgs e) {
131 if (property_grid.SelectedGridItem.Expandable)
132 property_grid.SelectedGridItem.Expanded = !property_grid.SelectedGridItem.Expanded;
136 base.OnDoubleClick (e);
139 protected override void OnPaint(PaintEventArgs e) {
140 // Decide if we need a scrollbar
141 open_grid_item_count = 0;
144 e.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), ClientRectangle);
147 e.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (property_grid.LineColor), 0,0,V_INDENT, ClientRectangle.Height);
150 int yLoc = -vbar.Value*row_height;
151 DrawGridItems(property_grid.grid_items, e, 1, ref yLoc);
161 protected override void OnMouseWheel(MouseEventArgs e) {
162 if (vbar == null || !vbar.Visible) {
167 vbar.Value = Math.Min(vbar.Value + SystemInformation.MouseWheelScrollLines, vbar.Maximum);
169 vbar.Value = Math.Max(0, vbar.Value - SystemInformation.MouseWheelScrollLines);
171 base.OnMouseWheel (e);
175 protected override void OnMouseMove (MouseEventArgs e) {
178 int loc = Math.Max(e.X,2*V_INDENT);
179 SplitterPercent = 1.0*loc/Width;
182 if (e.X > SplitterLocation - RESIZE_WIDTH && e.X < SplitterLocation + RESIZE_WIDTH)
183 this.Cursor = Cursors.SizeWE;
185 this.Cursor = Cursors.Default;
186 base.OnMouseMove (e);
189 protected override void OnMouseDown (MouseEventArgs e) {
190 if (e.X > SplitterLocation - RESIZE_WIDTH && e.X < SplitterLocation + RESIZE_WIDTH) {
191 resizing_grid = true;
194 int offset = -vbar.Value*row_height;
195 GridItem foundItem = GetSelectedGridItem(property_grid.grid_items, e.Y, ref offset);
197 if (foundItem != null) {
198 if (foundItem.Expandable) {
199 if (e.X >=3 && e.X <= 11 && (e.Y % row_height >= row_height/2-2 && e.Y % row_height <= row_height/2+4)) {
200 foundItem.Expanded = !foundItem.Expanded;
204 this.property_grid.SelectedGridItem = foundItem;
207 base.OnMouseDown (e);
211 protected override void OnMouseUp (MouseEventArgs e) {
212 resizing_grid = false;
216 protected override void OnKeyPress(KeyPressEventArgs e) {
217 if (property_grid.SelectedGridItem.Expandable)
218 property_grid.SelectedGridItem.Expanded = !property_grid.SelectedGridItem.Expanded;
224 #region Private Helper Methods
226 private int SplitterLocation{
228 return (int)(splitter_percent*Width);
232 private double SplitterPercent{
234 splitter_percent = Math.Max(Math.Min(value, .9),.1);
238 private GridItem GetSelectedGridItem (GridItemCollection grid_items, int y, ref int current) {
239 foreach (GridItem child_grid_item in grid_items) {
240 if (y > current && y < current + row_height) {
241 return child_grid_item;
243 current += row_height;
244 if (child_grid_item.Expanded) {
245 GridItem foundItem = GetSelectedGridItem(child_grid_item.GridItems, y, ref current);
246 if (foundItem != null)
253 private void UpdateScrollBar() {
254 int visible_rows = this.ClientRectangle.Height/row_height;
255 if (open_grid_item_count > visible_rows) {
257 vbar.SmallChange = 1;
259 vbar.Maximum = open_grid_item_count-1;
260 vbar.LargeChange = visible_rows;
263 vbar.Visible = false;
270 private void DrawGrid(PaintEventArgs pevent) {
271 Pen pen = ThemeEngine.Current.ResPool.GetPen(property_grid.LineColor);
272 // vertical divider line
273 pevent.Graphics.DrawLine(pen, SplitterLocation, 0, SplitterLocation, (open_grid_item_count-skipped_grid_items)*row_height);
276 while (y < ClientRectangle.Height && y/row_height + skipped_grid_items < open_grid_item_count) {
278 pevent.Graphics.DrawLine(pen, 0, y, ClientRectangle.Width, y);
283 private void DrawGridItems(GridItemCollection grid_items, PaintEventArgs pevent, int depth, ref int yLoc) {
284 foreach (GridItem grid_item in grid_items) {
285 DrawGridItem (grid_item, pevent, depth, ref yLoc);
286 if (grid_item.Expanded)
287 DrawGridItems(grid_item.GridItems, pevent, (grid_item.GridItemType == GridItemType.Category) ? depth : depth+1, ref yLoc);
291 private void DrawGridItemLabel(GridItem grid_item, PaintEventArgs pevent, Rectangle rect) {
293 if (grid_item.Parent != null && grid_item.Parent.GridItemType != GridItemType.Category)
296 Font font = this.Font;
297 Brush brush = SystemBrushes.WindowText;
298 if (grid_item.GridItemType == GridItemType.Category) {
300 brush = SystemBrushes.ControlDark;
303 if (grid_item == property_grid.SelectedGridItem && grid_item.GridItemType != GridItemType.Category) {
304 pevent.Graphics.FillRectangle (SystemBrushes.Highlight, rect);
306 brush = SystemBrushes.HighlightText;
310 if (grid_item.GridItemType == GridItemType.Category) {
311 pevent.Graphics.DrawString(grid_item.Label,font,brush,x, rect.Y + 2);
312 if (grid_item == property_grid.SelectedGridItem) {
313 SizeF size = pevent.Graphics.MeasureString(grid_item.Label, bold_font);
314 ControlPaint.DrawFocusRectangle(pevent.Graphics, new Rectangle(x,rect.Y+2, (int)size.Width, (int)size.Height));
318 pevent.Graphics.DrawString(grid_item.Label,font,brush,new Rectangle(x, rect.Y + 2,x-rect.X+rect.Width-2,rect.Height-2),string_format);
321 private void DrawGridItemValue(GridItem grid_item, PaintEventArgs pevent, Rectangle rect) {
323 if (grid_item.PropertyDescriptor != null) {
325 bool paintsValue = false;
326 UITypeEditor editor = null;
327 object temp = grid_item.PropertyDescriptor.GetEditor(typeof(UITypeEditor));
328 editor = (UITypeEditor)temp;//grid_item.PropertyDescriptor.GetEditor(typeof(UITypeEditor));
329 if (editor != null) {
330 paintsValue = editor.GetPaintValueSupported();
333 if (grid_item == property_grid.SelectedGridItem) {
334 grid_textbox.ReadOnly = false;
335 grid_textbox.DropDownButtonVisible = false;
336 grid_textbox.DialogButtonVisible = false;
337 if (editor != null) {
338 UITypeEditorEditStyle style = editor.GetEditStyle();
341 case UITypeEditorEditStyle.DropDown:
342 grid_textbox.DropDownButtonVisible = true;
344 case UITypeEditorEditStyle.Modal:
345 grid_textbox.DialogButtonVisible = true;
351 if (grid_item.PropertyDescriptor.Converter != null) {
352 if (grid_item.PropertyDescriptor.Converter.GetStandardValuesSupported()) {
354 grid_textbox.DropDownButtonVisible = true;
355 grid_textbox.ReadOnly = true;
359 System.Console.WriteLine("Converter not available for type {0}",grid_item.PropertyDescriptor.PropertyType);
370 int xLoc = SplitterLocation+1;
372 pevent.Graphics.DrawRectangle(Pens.Black, SplitterLocation+2,rect.Y+2, 20, row_height-4);
374 editor.PaintValue(grid_item.Value, pevent.Graphics, new Rectangle(SplitterLocation+3,rect.Y+3, 19, row_height-5));
376 catch (Exception ex) {
377 System.Console.WriteLine(ex.Message);
378 System.Console.WriteLine("Paint Value failed for type {0}",grid_item.PropertyDescriptor.PropertyType);
379 // design time stuff is not playing nice
384 Font font = this.Font;
386 if (grid_item.PropertyDescriptor.Converter != null) {
387 string value = grid_item.PropertyDescriptor.Converter.ConvertToString(grid_item.Value);
388 if (grid_item.PropertyDescriptor.CanResetValue(property_grid.SelectedObject))
391 pevent.Graphics.DrawString(value,font,SystemBrushes.WindowText,new RectangleF(xLoc,rect.Y+2, ClientRectangle.Width-(xLoc), row_height),string_format);
394 System.Console.WriteLine("No converter for type {0}",grid_item.PropertyDescriptor.PropertyType);
400 if (grid_item == property_grid.SelectedGridItem && grid_item.GridItemType != GridItemType.Category) {
401 grid_textbox.SetBounds(xLoc, rect.Top, ClientRectangle.Width-xLoc - (vbar.Visible ? vbar.Width: 0),row_height);
406 private void DrawGridItem (GridItem grid_item, PaintEventArgs pevent, int depth, ref int yLoc) {
407 if (yLoc > -row_height && yLoc < ClientRectangle.Height) {
408 if (grid_item.Expandable) {
409 grid_item.PlusMinusBounds = DrawPlusMinus(pevent.Graphics, 3, yLoc+row_height/2-3, grid_item.Expanded, grid_item.GridItemType == GridItemType.Category);
412 if (grid_item.GridItemType == GridItemType.Category) {
413 pevent.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (property_grid.LineColor), depth*V_INDENT,yLoc,ClientRectangle.Width-(depth*V_INDENT), row_height);
416 DrawGridItemLabel(grid_item, pevent, new Rectangle(depth*V_INDENT,yLoc, SplitterLocation-depth*V_INDENT, row_height));
417 DrawGridItemValue(grid_item, pevent, new Rectangle(SplitterLocation+2,yLoc, ClientRectangle.Width-SplitterLocation-2, row_height));
419 grid_item.Top = yLoc;
421 open_grid_item_count++;
424 private Rectangle DrawPlusMinus (Graphics g, int x, int y, bool expanded, bool category) {
425 Rectangle bounds = new Rectangle(x, y, 8, 8);
426 if (!category) g.FillRectangle (Brushes.White, bounds);
427 Pen pen = ThemeEngine.Current.ResPool.GetPen (property_grid.ViewForeColor);
428 g.DrawRectangle (pen, bounds);
429 g.DrawLine (pen, x+2, y+4, x + 6, y+4);
431 g.DrawLine (pen, x+4, y+2, x+4, y+6);
438 #region Event Handling
439 private void RedrawEvent (object sender, System.EventArgs e) {
443 private void TextBoxValidating (object sender, CancelEventArgs e) {
444 if (this.property_grid.SelectedGridItem != null) {
445 PropertyDescriptor desc = property_grid.SelectedGridItem.PropertyDescriptor;
448 if (desc.Converter != null) {
449 SetPropertyValue(desc.Converter.ConvertFromString(grid_textbox.Text));
452 System.Console.WriteLine("No converter for type {0}",desc.PropertyType);
456 Console.WriteLine("Error converting string");
464 private void ToggleValue() {
465 if (property_grid.SelectedGridItem.GridItemType == GridItemType.Property) {
466 if (property_grid.SelectedGridItem.PropertyDescriptor != null) {
467 if (property_grid.SelectedGridItem.PropertyDescriptor.PropertyType == typeof(bool))
468 SetPropertyValue(!(bool)property_grid.SelectedGridItem.Value);
469 else if (property_grid.SelectedGridItem.PropertyDescriptor.Converter.GetStandardValuesSupported()){
470 System.ComponentModel.TypeConverter.StandardValuesCollection coll =
471 (System.ComponentModel.TypeConverter.StandardValuesCollection)property_grid.SelectedGridItem.PropertyDescriptor.Converter.GetStandardValues();
472 for (int i = 0; i < coll.Count; i++) {
473 if (property_grid.SelectedGridItem.Value.Equals(coll[i])){
474 if (i < coll.Count-1)
475 SetPropertyValue(coll[i+1]);
477 SetPropertyValue(coll[0]);
487 private void dropdown_form_Deactivate (object sender, EventArgs e) {
488 dropdown_form.Hide();
491 private void listBox_MouseUp(object sender, MouseEventArgs e) {
492 AcceptListBoxSelection (sender);
495 private void listBox_KeyDown(object sender, KeyEventArgs e)
497 switch (e.KeyData & Keys.KeyCode) {
499 AcceptListBoxSelection (sender);
502 dropdown_form.Hide();
507 void AcceptListBoxSelection (object sender) {
508 if (this.property_grid.SelectedGridItem != null) {
509 PropertyDescriptor desc = property_grid.SelectedGridItem.PropertyDescriptor;
511 SetPropertyValue(((ListBox)sender).SelectedItem);
514 dropdown_form.Hide();
518 private void SetPropertyValue(object newVal) {
519 if (this.property_grid.SelectedGridItem != null) {
520 PropertyDescriptor desc = property_grid.SelectedGridItem.PropertyDescriptor;
522 object target = property_grid.SelectedObject;
523 if (property_grid.SelectedGridItem.Parent != null)
524 target = property_grid.SelectedGridItem.Parent.Value;
525 desc.SetValue(target, newVal);
530 private void DropDownButtonClicked (object sender, EventArgs e) {
531 UITypeEditor editor = property_grid.SelectedGridItem.PropertyDescriptor.GetEditor (typeof (UITypeEditor)) as UITypeEditor;
532 if (editor == null) {
533 if (dropdown_form.Visible) {
534 dropdown_form.Hide ();
537 dropdown_form.Deactivate +=new EventHandler(dropdown_form_Deactivate);
538 ListBox listBox = new ListBox();
539 listBox.BorderStyle = BorderStyle.FixedSingle;
540 listBox.Dock = DockStyle.Fill;
541 int selected_index = 0;
543 foreach (object obj in property_grid.SelectedGridItem.PropertyDescriptor.Converter.GetStandardValues()) {
544 listBox.Items.Add(obj);
545 if (property_grid.SelectedGridItem.Value.Equals(obj))
549 listBox.SelectedIndex = selected_index;
550 listBox.KeyDown += new KeyEventHandler(listBox_KeyDown);
551 listBox.MouseUp+=new MouseEventHandler(listBox_MouseUp);
552 dropdown_form.Controls.Clear();
553 dropdown_form.Controls.Add(listBox);
554 dropdown_form.Location = PointToScreen(new Point(SplitterLocation,grid_textbox.Location.Y+row_height));
555 dropdown_form.Width = this.Width - this.SplitterLocation;
556 dropdown_form.ActiveControl = listBox;
557 dropdown_form.Show();
559 } else { // use editor
560 SetPropertyValueFromUITypeEditor (editor);
564 void SetPropertyValueFromUITypeEditor (UITypeEditor editor)
566 ServiceContainer service_container = new ServiceContainer ();
567 service_container.AddService (typeof (IWindowsFormsEditorService), this);
568 object value = editor.EditValue (
569 new ITypeDescriptorContextImpl (this.property_grid),
571 property_grid.SelectedGridItem.Value);
572 SetPropertyValue (value);
575 private void DialogButtonClicked(object sender, EventArgs e) {
576 UITypeEditor editor = property_grid.SelectedGridItem.PropertyDescriptor.GetEditor (typeof (UITypeEditor)) as UITypeEditor;
578 SetPropertyValueFromUITypeEditor (editor);
581 private void HandleValueChanged(object sender, EventArgs e) {
582 if (vbar.Value <= 0) {
585 if (vbar.Value > vbar.Maximum-ClientRectangle.Height/row_height) {
586 vbar.Value = vbar.Maximum-ClientRectangle.Height/row_height+1;
589 int scroll_amount = (skipped_grid_items-vbar.Value)*row_height;
590 XplatUI.ScrollWindow(Handle, 0, scroll_amount, false);
591 skipped_grid_items = vbar.Value;
592 if (scroll_amount > 0)
593 Invalidate(new Rectangle(0,0,Width,scroll_amount+1));
595 Invalidate(new Rectangle(0,Height+scroll_amount-1,Width,1-scroll_amount));
598 private void grid_textbox_ToggleValue(object sender, EventArgs e) {
603 private void HandleSelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e) {
604 // Region not working correctly
605 //Region clip = new Region();
606 //if (property_grid.SelectedGridItem != null)
607 // clip.Union(new Rectangle(0,property_grid.SelectedGridItem.Top, ClientRectangle.Width, row_height));
608 // clip.Union(new Rectangle(0,property_grid.SelectedGridItem.Top, ClientRectangle.Width, row_height));
610 if (e.NewSelection.GridItemType == GridItemType.Property)
611 grid_textbox.Visible = true;
613 grid_textbox.Visible = false;
615 if (e.NewSelection.PropertyDescriptor != null) {
616 grid_textbox.Text = e.NewSelection.PropertyDescriptor.Converter.ConvertToString(e.NewSelection.Value);
617 if (e.NewSelection.PropertyDescriptor.CanResetValue(property_grid.SelectedObject))
618 grid_textbox.Font = bold_font;
620 grid_textbox.Font = this.Font;
623 Invalidate(/*clip*/this.ClientRectangle);
627 private void HandlePropertyValueChanged(object s, PropertyValueChangedEventArgs e) {
628 if (e.ChangedItem.PropertyDescriptor != null) {
629 grid_textbox.Text = e.ChangedItem.PropertyDescriptor.Converter.ConvertToString(e.ChangedItem.Value);
630 if (e.ChangedItem.PropertyDescriptor.CanResetValue(property_grid.SelectedObject))
631 grid_textbox.Font = bold_font;
633 grid_textbox.Font = this.Font;
641 #region IWindowsFormsEditorService Members
643 public void CloseDropDown() {
644 dropdown_form.Hide();
647 public void DropDownControl(Control control) {
650 dropdown_form.Deactivate +=new EventHandler(dropdown_form_Deactivate);
651 dropdown_form.Size = control.Size;
652 control.Dock = DockStyle.Fill;
653 dropdown_form.Controls.Clear();
654 dropdown_form.Controls.Add(control);
655 dropdown_form.Location = PointToScreen(new Point(SplitterLocation,grid_textbox.Location.Y+row_height));
656 dropdown_form.Width = Width - SplitterLocation;
658 dropdown_form.Show();
659 System.Windows.Forms.MSG msg = new MSG();
660 queue_id = XplatUI.StartLoop(Thread.CurrentThread);
661 while (XplatUI.GetMessage(queue_id, ref msg, IntPtr.Zero, 0, 0) && dropdown_form.Visible) {
662 XplatUI.TranslateMessage(ref msg);
663 XplatUI.DispatchMessage(ref msg);
667 public System.Windows.Forms.DialogResult ShowDialog(Form dialog) {
668 return dialog.ShowDialog(this);
673 #region Internal Classes
674 internal class ITypeDescriptorContextImpl : System.ComponentModel.ITypeDescriptorContext {
675 private PropertyGrid property_grid;
676 public ITypeDescriptorContextImpl(PropertyGrid propertyGrid) {
677 property_grid = propertyGrid;
679 #region ITypeDescriptorContext Members
681 public void OnComponentChanged() {
682 // TODO: Add SystemComp.OnComponentChanged implementation
685 public IContainer Container {
687 return property_grid as IContainer;
691 public bool OnComponentChanging() {
692 // TODO: Add SystemComp.OnComponentChanging implementation
696 public object Instance {
698 return property_grid.SelectedGridItem.Value;
702 public PropertyDescriptor PropertyDescriptor {
704 return property_grid.SelectedGridItem.PropertyDescriptor;
710 #region IServiceProvider Members
712 public object GetService(Type serviceType) {
713 // TODO: Add SystemComp.GetService implementation
726 internal class PropertyGridDropDown : Form {
727 protected override CreateParams CreateParams {
729 CreateParams cp = base.CreateParams;
730 cp.Style = unchecked ((int)(WindowStyles.WS_POPUP | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_CLIPCHILDREN));
731 cp.ExStyle |= (int)(WindowExStyles.WS_EX_TOOLWINDOW | WindowExStyles.WS_EX_TOPMOST);