barcode label printing in vb.net IMPROVING USABILITY in .NET framework

Drawer ECC200 in .NET framework IMPROVING USABILITY

IMPROVING USABILITY
Printing Data Matrix In VS .NET
Using Barcode printer for ASP.NET Control to generate, create ECC200 image in ASP.NET applications.
www.OnBarcode.com
Barcode Printer In .NET Framework
Using Barcode printer for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Now that we ve got a custom zone, we simply add an override for the OnCreateVerbs method and implement our own logic within that method. The code in listing 7.4 shows what our implementation of the OnCreateVerbs method looks like.
Encoding QR In .NET Framework
Using Barcode encoder for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
www.OnBarcode.com
Paint Barcode In VS .NET
Using Barcode generation for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Listing 7.4 By overriding the OnCreateVerbs method of the zone the existing edit verb is hidden and a custom edit verb added.
Making 2D In .NET
Using Barcode printer for ASP.NET Control to generate, create Matrix Barcode image in ASP.NET applications.
www.OnBarcode.com
Draw Code 128 Code Set B In .NET
Using Barcode creation for ASP.NET Control to generate, create Code-128 image in ASP.NET applications.
www.OnBarcode.com
protected override void OnCreateVerbs(WebPartVerbsEventArgs e) { base.OnCreateVerbs(e);
UCC.EAN - 128 Encoder In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create EAN 128 image in ASP.NET applications.
www.OnBarcode.com
Leitcode Drawer In .NET
Using Barcode encoder for ASP.NET Control to generate, create Leitcode image in ASP.NET applications.
www.OnBarcode.com
Force the standard edit verb to be hidden this.EditVerb.Visible = false; Collection<WebPartVerb> verbs = new Collection<WebPartVerb>();
Encode Data Matrix ECC200 In Objective-C
Using Barcode generator for iPhone Control to generate, create Data Matrix ECC200 image in iPhone applications.
www.OnBarcode.com
Data Matrix 2d Barcode Maker In Visual C#.NET
Using Barcode generation for Visual Studio .NET Control to generate, create DataMatrix image in Visual Studio .NET applications.
www.OnBarcode.com
HttpContext ctx = HttpContext.Current; if (ctx.Request.IsAuthenticated) {
Making GS1 128 In None
Using Barcode printer for Software Control to generate, create USS-128 image in Software applications.
www.OnBarcode.com
Code 128C Creator In Visual Basic .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create USS Code 128 image in .NET applications.
www.OnBarcode.com
WebPartVerb editVerb = new WebPartVerb( "editVerb", new WebPartEventHandler(HandleEditClick) ); verbs.Add(editVerb);
Universal Product Code Version A Drawer In .NET Framework
Using Barcode encoder for Reporting Service Control to generate, create UPC Code image in Reporting Service applications.
www.OnBarcode.com
Read QR Code JIS X 0510 In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
Display the edit verb if the user is authenticated
Decoding Barcode In VB.NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Barcode Generation In None
Using Barcode maker for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Display the appropriate text for the verb
Generating Code 128 Code Set C In .NET
Using Barcode creation for Reporting Service Control to generate, create Code 128B image in Reporting Service applications.
www.OnBarcode.com
Create GS1 DataBar Expanded In Java
Using Barcode maker for Java Control to generate, create GS1 DataBar image in Java applications.
www.OnBarcode.com
if (this.WebPartManager.Personalization.Scope == PersonalizationScope.Shared) { editVerb.Text = "Edit Shared Web Part"; } else { editVerb.Text = "Edit Web Part"; } } e.Verbs = new WebPartVerbCollection(verbs); }
Printing EAN / UCC - 13 In Objective-C
Using Barcode creation for iPhone Control to generate, create EAN 13 image in iPhone applications.
www.OnBarcode.com
Code 39 Full ASCII Printer In None
Using Barcode printer for Excel Control to generate, create Code-39 image in Microsoft Excel applications.
www.OnBarcode.com
The first thing that we do in the OnCreateVerbs method is to hide the in-built edit verb so that it isn t displayed to the user. After we ve hidden the existing edit verb we then go about adding our new verb. It s worth noting that in our implementation we simply check if the user is authenticated before adding the new verb but we could base our logic on some other check, such as whether the user is in a certain role group. The last thing that we do before we set the Verbs property of the EventArgs that are passed to us is to change the text to provide the user with a visual cue of whether they are about to edit the shared view or the per-user view of the web part. The code that runs when the user clicks the edit verb can be seen in the following code snippet:
CREATING AN ENHANCED EDITING EXPERIENCE
void HandleEditClick(object sender, WebPartEventArgs e) { WebPart wp = e.WebPart; if (wp != this.WebPartManager.SelectedWebPart) { this.WebPartManager.DisplayMode = WebPartManager.EditDisplayMode; this.WebPartManager.BeginWebPartEditing(wp); } }
In this method we first check that the web part is not already being edited and then we switch the page into edit mode. With the mode set to edit, we can commence editing on the web part by calling the BeginWebPartEditing method on the current web part manager instance for the page. Using the custom EditorZone Now that we ve created our custom WebPartZone class we must register the namespace of the class with the web page so that it can be used. After registering the namespace we can convert the control declarations for the existing web part zones over to use our new class. The following snippet of code shows the register declaration that makes our new class available to the page, and then shows the server tags that should be used for the web part zones on the page:
<%@ Register Namespace="AW.Portal.Web" TagPrefix="portal" %>
<portal:PortalWebPartZone ID="LeftZone" runat="server"> ... </portal:PortalWebPartZone>
Aftrer changing the code in the Default.aspx page so that our new web part zone class is used we should run the page and check that everything is working well and that everything compiles. Having confirmed that everything is running, you might notice that after changing the class that is used for the web part zones, all the styles have disappeared from the web parts and their associated menus. This occurs because, when we changed the tag for our web part zones from asp:WebPartZone to portal:PortWebPartZone, the styles that we ve already defined in the Theme folder no longer match the new control tag. To get the styles re-applied we can simply open the theme file and change the themed control to match our new tag as shown in listing 7.5. Note that the register declaration is also added to the theme file in the same way that it was added in the page.
IMPROVING USABILITY
Listing 7.5 Declaring the theme information for our custom EditorZone and adding a dashed border for selected web parts.
<%@ Register Namespace="AW.Portal.Web" TagPrefix="portal" %> <portal:PortalWebPartZone runat="server" BorderColor="#CCCCCC" FontNames="Verdana" Padding="6"> <PartChromeStyle BackColor="#EFF3FB" BorderColor="#D1DDF1" FontNames="Verdana" ForeColor="#333333" /> <SelectedPartChromeStyle BorderStyle="Dashed" BorderWidth="4" BorderColor="#da8b32" /> Display a dashed border <MenuLabelHoverStyle ForeColor="#D1DDF1" /> for selected web parts <MenuLabelStyle ForeColor="White" /> <MenuVerbHoverStyle BackColor="#EFF3FB" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" /> <HeaderStyle Font-Size="0.9em" ForeColor="#CCCCCC" HorizontalAlign="Center" /> <MenuVerbStyle BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" /> <PartStyle Font-Size="1em" ForeColor="#333333" /> <TitleBarVerbStyle Font-Underline="False" ForeColor="White" /> <MenuPopupStyle BackColor="#507CD1" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" /> <PartTitleStyle BackColor="#507CD1" Font-Bold="True" FontSize="1em" ForeColor="White" /> </portal:PortalWebPartZone>
Notice that the themed control now matches the control that we are using on the Default.aspx page in the Adventure Works portal. I also added a style for the SelectedPartChromeStyle to add a dashed border to a web part when it is selected. This is a visual feature that I like to add in my own portals as it makes it very obvious what web part is being edited. This feature is not so important when there are only a small number of web parts on a page but as the number of web parts on the page grows, remembering which web part is being edited can get difficult. Figure 7.9 shows how web parts appear when in edit mode based on the new theme style. That s it! With single-click editing in place we can feel confident that we ve done our small bit to reduce the internet s unnecessary clicks. Another unnecessary evil in web applications is pages that require the user to scroll up and down or from side to side in order to view content. I m sure that you re aware of this one too. The root of this evil is content that is either really wide or extra long, or worse still both! You often see this in reporting applications and it means that you have to constantly scroll backwards and forwards or up and down to read all of the content. This type of problem can easily manifest itself in our portals with the EditorZone control. Think about it for a moment. Here you have a control that will often display 218
Copyright © OnBarcode.com . All rights reserved.