Redigera

Dela via


WebPartZoneBase.DragHighlightColor Property

Definition

Gets or sets the color around the border of a WebPartZoneBase zone and its drop-cue regions when a user is dragging a control.

public:
 virtual property System::Drawing::Color DragHighlightColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual System.Drawing.Color DragHighlightColor { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))>]
member this.DragHighlightColor : System.Drawing.Color with get, set
Public Overridable Property DragHighlightColor As Color

Property Value

A Color that contains the highlight color. The default color is Blue.

Attributes

Examples

The following code example demonstrates the declarative use of the DragHighlightColor property on a WebPartZone control. For the full code example, including the code-behind source file and the .aspx page that contains the zone in this code, see the WebPartZoneBase class overview.

Notice that the DragHighlightColor property value is set to a specific color. After you load the page into a browser and switch the page into design display mode, you can see the effect of the property when you select and drag the control within its zone, or drag another control into the zone.

<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>

Remarks

When a dragged control is held over a zone where it can be dropped, drop-cue regions appear, showing the area in which the control can be dropped, and it is for these regions, as well as the zone itself, that the DragHighlightColor property affects the border color.

The DragHighlightColor property enables you to set the color that appears to a user when they drag a control in the zone. The DragHighlightColor property takes effect only when a Web page is in a display mode that enables the layout of a zone to be changed, such as DesignDisplayMode.

Applies to

See also