Examples. Products. W informs Controls > Products > Navigation Bar > Examples. This topic provides how -to examples, grouped by features.

Size: px
Start display at page:

Download "Examples. Products. W informs Controls > Products > Navigation Bar > Examples. This topic provides how -to examples, grouped by features."

Transcription

1 Examples 3564 W informs Controls > Products > Navigation Bar > Examples This topic provides how -to examples, grouped by features. Examples Layout How to: Create a NavBar Control in Code How to: Activate a Group How to: Adjust Group's Drag and Drop Options How to: Adjust the Control's Drag and Drop Options How to: Create Groups and Items How to: Embed a DateControl into a Group How to: Expand and Collapse Groups How to: Hide a NavBar's Item How to: Iterate Through Groups and Links of Each Group How to: Iterate over NavBarControl Items How to: Keep Links Sorted How to: Prohibit Dropping to a Group Appearance How to: Apply Alpha Blending to the Control's Background How to: Assign Images to Group Captions and Contained Links How to: Change the Navbar Control's View How to: Create and Modify the Control's Large Image List How to: Create and Modify the Control's Small Image List How to: Custom Paint Group Captions How to: Custom Paint Hints How to: Custom Paint Links How to: Custom Paint the Control's Background How to: Custom Paint the Group's Client Background How to: Custom Paint the Group's Client Foreground How to: Customize Display Information via Custom Draw Events How to: Iterate Through Available Paint Styles Miscellaneous How to: Assign Hints to the NavBarControl's Groups How to: Assign Hints to the NavBarControl's Items How to: Get the Group That Is Hovered Over How to: Get the Link That Is Hovered Over How to: Get the Type of Element That Is Hovered Over How to: Save Control Layout to an XML File and Then Restore It How to: Save Control Layout to the Registry and Then Restore It How to: Save the Control Layout to a Stream and Then Restore It 2013 DevExpress Inc. 3564

2 Appearance How to: Apply Alpha Blending to the Control's Background 3565 The follow ing sample code assigns background images to the XtraNavBar and its groups. The NavBarGroup. BackgroundImage and NavBarControl.GroupBackgroundImage properties are used for this purpose. The NavBarControl.BeginUpdate and NavBarControl.EndUpdate methods are used to avoid repeated redraw ing when changes are implemented. The image below show s the nav bar before and after the code below has been executed. navbarcontrol1.beginupdate(); // Assigning an image to the control's background. navbarcontrol1.backgroundimage = Image.FromFile("C:\\Images\\Textures\\controlBack.gif"); // Making the control's background transparent. navbarcontrol1.appearance.background.backcolor = Color.FromArgb(0, 0, 0, 0); // Assigning an image to the background of the groups. navbarcontrol1.groupbackgroundimage = Image.FromFile("C:\\Images\\Textures\\groupsBack.gif"); // Making the background transparent. navbarcontrol1.appearance.groupbackground.backcolor = Color.FromArgb(0, 0, 0, 0); navbarcontrol1.endupdate(); NavBarControl1.BeginUpdate() ' Assigning an image to the control's background. NavBarControl1.BackgroundImage = Image.FromFile("C:\Images\Textures\controlBack.gif") ' Making the control's background transparent. NavBarControl1.Appearance.Background.BackColor = Color.FromArgb(0, 0, 0, 0) ' Assigning an image to the background of the groups. NavBarControl1.GroupBackgroundImage = Image.FromFile("C:\Images\Textures\groupsBack.gif") ' Making the background transparent. NavBarControl1.Appearance.GroupBackground.BackColor = Color.FromArgb(0, 0, 0, 0) NavBarControl1.EndUpdate() 2013 DevExpress Inc. 3565

3 How to: Assign Images to Group Captions and Contained Links 3566 The follow ing sample code assigns a large image to a group caption and small images to contained links. The NavElement.SmallImage and NavElement.LargeImage properties of a group and items are used for this purpose. The NavBarGroup.UseSmallImage property is set to false to display a large image w ithin the group caption. The NavBarGroup.GroupStyle property is set to true to display small images within links. The image below displays a NavBarControl control before and after sample code execution. using DevExpress.XtraNavBar; //... NavBarGroup helpgroup = navbarcontrol1.groups[1]; helpgroup.largeimage = Image.FromFile("E:\\Images\\Icons\\MSHelpLarge.bmp"); NavBarItem indexitem = helpgroup.itemlinks[0].item; indexitem.smallimage = Image.FromFile("E:\\Images\\Icons\\index.bmp"); NavBarItem contentsitem = helpgroup.itemlinks[1].item; contentsitem.smallimage = Image.FromFile("E:\\Images\\Icons\\bookClosed.bmp"); helpgroup.usesmallimage = false; helpgroup.linksusesmallimage = true; Imports DevExpress.XtraNavBar '... Dim HelpGroup As NavBarGroup = NavBarControl1.Groups(1) HelpGroup.LargeImage = Image.FromFile("E:\Images\Icons\MSHelpLarge.bmp") Dim IndexItem As NavBarItem = HelpGroup.ItemLinks(0).Item IndexItem.SmallImage = Image.FromFile("E:\Images\Icons\index.bmp") Dim ContentsItem As NavBarItem = HelpGroup.ItemLinks(1).Item ContentsItem.SmallImage = Image.FromFile("E:\Images\Icons\bookClosed.bmp") HelpGroup.UseSmallImage = False HelpGroup.LinksUseSmallImage = True 2013 DevExpress Inc. 3566

4 How to: Change the Navbar Control's View 3567 The follow ing code shows how to change a NavBarControl's View via the NavBarControl.PaintStyleName property. navbarcontrol1.paintstylename = "XP1View"; NavBarControl1.PaintStyleName = "XP1View" 2013 DevExpress Inc. 3567

5 How to: Change the Navbar Control's View Type 3568 The follow ing example shows how to apply the Navigation Pane View type to a NavBarControl via the NavBarControl.PaintStyleKind property. Then, the default look and feel scheme is changed via the Default Look And Feel object. As a result, all controls, including the NavBarControl, w ill be painted using the "Money Twins" skin. using DevExpress.LookAndFeel; using DevExpress.XtraNavBar; // Applies the Navigation Pane View type navbarcontrol1.paintstylekind = NavBarViewKind.NavigationPane; // Changes the default look and feel scheme to the Money Twins skin. UserLookAndFeel.Default.Style = LookAndFeelStyle.Skin; UserLookAndFeel.Default.SkinName = "Money Twins"; Imports DevExpress.LookAndFeel Imports DevExpress.XtraNavBar ' Applies the Navigation Pane View type Private navbarcontrol1.paintstylekind = NavBarViewKind.NavigationPane ' Changes the default look and feel scheme to the Money Twins skin. Private UserLookAndFeel.Default.Style = LookAndFeelStyle.Skin Private UserLookAndFeel.Default.SkinName = "Money Twins" 2013 DevExpress Inc. 3568

6 How to: Create and Modify the Control's Large Image List 3569 The follow ing sample code creates and modifies an image list that w ill serve as the source of large images for the control. The modified component is assigned to the NavBarControl.LargeImages property. The NavElement. LargeImageIndex property is used to assign images to items and a group. The NavBarGroup.UseSmallImage and NavBarGroup.GroupStyle properties are set to false to enable displaying large images. The image below displays the control's look & feel before and after code execution: using DevExpress.XtraNavBar; // adjusting an image list ImageList largeimagesource = new ImageList(); largeimagesource.imagesize = new Size(32, 32); largeimagesource.images.add(image.fromfile("e:\\images\\icons\\mshelplarge.bmp")); largeimagesource.images.add(image.fromfile("e:\\images\\icons\\indexlarge.bmp")); largeimagesource.images.add(image.fromfile("e:\\images\\icons\\bookclosedlarge.bmp")); // setting the image list as the source of large images navbarcontrol1.largeimages = largeimagesource; // assigning a large image to a group caption NavBarGroup currgroup = navbarcontrol1.groups[1]; currgroup.largeimageindex = 0; currgroup.usesmallimage = false; // assigning large images to items currgroup.itemlinks[0].item.largeimageindex = 1; currgroup.itemlinks[1].item.largeimageindex = 2;?urrGroup.LinksUseSmallImage = false; Imports DevExpress.XtraNavBar '... ' adjusting an image list Dim LargeImageSource As New ImageList() LargeImageSource.ImageSize = New Size(32, 32) LargeImageSource.Images.Add(Image.FromFile("E:\Images\Icons\MSHelpLarge.bmp")) LargeImageSource.Images.Add(Image.FromFile("E:\Images\Icons\IndexLarge.bmp")) LargeImageSource.Images.Add(Image.FromFile("E:\Images\Icons\BookClosedLarge.bmp")) ' setting the image list as the source of large images NavBarControl1.LargeImages = LargeImageSource ' assigning a large image to a group caption Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(1) 2013 DevExpress Inc. 3569

7 3570 CurrGroup.LargeImageIndex = 0 CurrGroup.UseSmallImage = False ' assigning large images to items CurrGroup.ItemLinks(0).Item.LargeImageIndex = 1 CurrGroup.ItemLinks(1).Item.LargeImageIndex = 2 CurrGroup.LinksUseSmallImage = False 2013 DevExpress Inc. 3570

8 How to: Create and Modify the Control's Small Image List 3571 The follow ing sample code creates and modifies an image list that w ill serve as the source of small images for the control. The modified component is assigned to the NavBarControl.LargeImages property. The NavElement. SmallImageIndex property is used to assign images to items and a group. The NavBarGroup.UseSmallImage and NavBarGroup.GroupStyle properties are set to true to enable the display of small images. The image below displays the control's look & feel before and after code execution: using DevExpress.XtraNavBar; //... // adjusting an image list ImageList smallimagesource = new ImageList(); smallimagesource.imagesize = new Size(16, 16); smallimagesource.transparentcolor = Color.Magenta; smallimagesource.images.add(image.fromfile("e:\\images\\icons\\mshelp.bmp")); smallimagesource.images.add(image.fromfile("e:\\images\\icons\\index.bmp")); smallimagesource.images.add(image.fromfile("e:\\images\\icons\\bookclosed.bmp")); // setting the image list as the source of small images navbarcontrol1.smallimages = smallimagesource; // assigning a small image to a group caption NavBarGroup currgroup = navbarcontrol1.groups[1]; currgroup.smallimageindex = 0; currgroup.usesmallimage = true; // assigning small images to items currgroup.itemlinks[0].item.smallimageindex = 1; currgroup.itemlinks[1].item.smallimageindex = 2; currgroup.linksusesmallimage = true; Imports DevExpress.XtraNavBar '... ' adjusting an image list Dim SmallImageSource As New ImageList() SmallImageSource.ImageSize = New Size(16, 16) SmallImageSource.Images.Add(Image.FromFile("E:\Images\Icons\MSHelp.bmp")) SmallImageSource.Images.Add(Image.FromFile("E:\Images\Icons\Index.bmp")) SmallImageSource.Images.Add(Image.FromFile("E:\Images\Icons\BookClosed.bmp")) ' setting the image list as the source of small images NavBarControl1.SmallImages = SmallImageSource 2013 DevExpress Inc. 3571

9 3572 ' assigning a small image to a group caption Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(3) CurrGroup.SmallImageIndex = 0 CurrGroup.UseSmallImage = True ' assigning small images to items CurrGroup.ItemLinks(0).Item.SmallImageIndex = 1 CurrGroup.ItemLinks(1).Item.SmallImageIndex = 2 CurrGroup.LinksUseSmallImage = True 2013 DevExpress Inc. 3572

10 How to: Custom Paint Group Captions 3573 The follow ing sample code handles the NavBarControl.CustomDraw GroupCaption event to custom paint the borders around group captions, fill in the background and paint its text. The background is filled in, in various different w ays depending upon the state of the group's caption. The image below show s the look & feel of group captions in the normal, hot tracked and pressed states, respectively. using System.Drawing.Drawing2D; using DevExpress.Utils.Drawing; using DevExpress.XtraNavBar.ViewInfo; private void navbarcontrol1_customdrawgroupcaption(object sender, CustomDrawNavBarElementEventArgs e) { // painting the borders Rectangle outerrect = e.realbounds; SolidBrush outerbrush = new SolidBrush(Color.Orange); using(outerbrush) { e.graphics.fillrectangle(outerbrush, outerrect); // painting the background Rectangle innerrect = outerrect; innerrect.inflate(-1, -1); LinearGradientBrush innerbrush; if (e.objectinfo.state == ObjectState.Hot) innerbrush = new LinearGradientBrush(innerRect, Color.PeachPuff, Color.Orange, LinearGradientMode.Vertical); else if (e.objectinfo.state == ObjectState.Normal) innerbrush = new LinearGradientBrush(innerRect, Color.Orange, Color.PeachPuff, LinearGradientMode.Horizontal); else innerbrush = new LinearGradientBrush(innerRect, Color.Orange, Color.PeachPuff, LinearGradientMode.Vertical); using(innerbrush) { e.graphics.fillrectangle(innerbrush, innerrect); // painting the caption StringFormat outstringformat = new StringFormat(); outstringformat.alignment = StringAlignment.Near; outstringformat.linealignment = StringAlignment.Center; SolidBrush textbrush = new SolidBrush(Color.White); NavGroupInfoArgs info = e.objectinfo as NavGroupInfoArgs; using(textbrush) { e.graphics.drawstring(info.group.caption, e.appearance.font, textbrush, innerrect, outstringformat); // prohibiting default painting 2013 DevExpress Inc. 3573

11 3574 e.handled = true; Imports System.Drawing.Drawing2D Imports DevExpress.Utils.Drawing Imports DevExpress.XtraNavBar.ViewInfo Private Sub NavBarControl1_CustomDrawGroupCaption(ByVal sender As Object, _ ByVal e As CustomDrawNavBarElementEventArgs) Handles NavBarControl1.CustomDrawGroupCaption ' painting the borders Dim OuterRect As Rectangle = e.realbounds Dim OuterBrush As New SolidBrush(Color.Orange) e.graphics.fillrectangle(outerbrush, OuterRect) OuterBrush.Dispose() ' painting the background Dim InnerRect As Rectangle = OuterRect InnerRect.Inflate(-1, -1) Dim InnerBrush As LinearGradientBrush If e.objectinfo.state = ObjectState.Hot Then InnerBrush = New LinearGradientBrush(InnerRect, Color.PeachPuff, Color.Orange, _ LinearGradientMode.Vertical) ElseIf e.objectinfo.state = ObjectState.Normal Then InnerBrush = New LinearGradientBrush(InnerRect, Color.Orange, Color.PeachPuff, _ LinearGradientMode.Horizontal) Else InnerBrush = New LinearGradientBrush(InnerRect, Color.Orange, Color.PeachPuff, _ LinearGradientMode.Vertical) End If e.graphics.fillrectangle(innerbrush, InnerRect) InnerBrush.Dispose() ' painting the caption Dim TextRect As New RectangleF(InnerRect.Left, InnerRect.Top, InnerRect.Width, _ InnerRect.Height) Dim TextBrush As New SolidBrush(Color.Blue) Dim OutStringFormat As New StringFormat() OutStringFormat.Alignment = StringAlignment.Near OutStringFormat.LineAlignment = StringAlignment.Center Dim info As NavGroupInfoArgs = e.objectinfo e.graphics.drawstring(info.group.caption, e.style.font, TextBrush, TextRect, _ OutStringFormat) TextBrush.Dispose() ' prohibiting default painting e.handled = True End Sub 2013 DevExpress Inc. 3574

12 How to: Custom Paint Hints 3575 The sample code below handles the NavBarControl.CustomDrawHint event to custom paint hints in the VSToolBoxView style. The NavBarControl.CalcHintSize event is handled to adjust the size of the hints in order to draw their outer borders. The image below show s the result. using System.Drawing.Drawing2D; private void navbarcontrol1_calchintsize(object sender, NavBarCalcHintSizeEventArgs e) { // Enlarge the size of the hint to create space for drawing borders Size NewSize = e.size; NewSize.Width += 18; NewSize.Height += 8; e.size = new Size(NewSize.Width, NewSize.Height); private void navbarcontrol1_customdrawhint(object sender, NavBarCustomDrawHintEventArgs e) { // Obtain the object used to paint. Graphics gr = e.paintargs.graphics; // Paint borders. LinearGradientBrush outerbrush = new LinearGradientBrush(e.Bounds, Color.LightSkyBlue, Color.Blue, LinearGradientMode.Vertical); gr.fillrectangle(outerbrush, e.bounds); outerbrush.dispose(); // Paint the background. // The background rectangle is reduced to make the borders visible. Rectangle innerrect = Rectangle.Inflate(e.Bounds, -3, -3); LinearGradientBrush innerbrush = new LinearGradientBrush(e.Bounds, Color.Blue, Color.LightSkyBlue, LinearGradientMode.Vertical); gr.fillrectangle(innerbrush, innerrect); innerbrush.dispose(); // Format the output string. RectangleF textrect = new RectangleF(innerRect.Left, innerrect.top, innerrect.width, innerrect.height); StringFormat outstringformat = new StringFormat(); outstringformat.alignment = StringAlignment.Center; outstringformat.linealignment = StringAlignment.Center; // Paint text. SolidBrush textbrush = new SolidBrush(Color.White); gr.drawstring(e.hint, e.appearance.font, textbrush, textrect, outstringformat); textbrush.dispose(); // Prohibit default hint painting e.handled = true; Imports DevExpress.XtraNavBar 2013 DevExpress Inc. 3575

13 3576 Imports System.Drawing.Drawing2D Private Sub NavBarControl1_CalcHintSize(ByVal sender As System.Object, _ ByVal e As NavBarCalcHintSizeEventArgs) Handles NavBarControl1.CalcHintSize ' Enlarge the size of the hint to create space for drawing borders Dim NewSize As Size = e.size NewSize.Width += 18 NewSize.Height += 8 e.size = New Size(NewSize.Width, NewSize.Height) End Sub Private Sub NavBarControl1_CustomDrawHint(ByVal sender As System.Object, _ ByVal e As NavBarCustomDrawHintEventArgs) Handles NavBarControl1.CustomDrawHint ' Obtain the object used to paint. Dim gr As Graphics = e.paintargs.graphics ' Paint borders. Dim outerbrush As LinearGradientBrush = New LinearGradientBrush(e.Bounds, _ Color.LightSkyBlue, Color.Blue, LinearGradientMode.Vertical) gr.fillrectangle(outerbrush, e.bounds) outerbrush.dispose() ' Paint the background. ' The background rectangle is reduced to make the borders visible. Dim innerrect As Rectangle = Rectangle.Inflate(e.Bounds, -3, -3) Dim innerbrush As LinearGradientBrush = New LinearGradientBrush(e.Bounds, _ Color.Blue, Color.LightSkyBlue, LinearGradientMode.Vertical) gr.fillrectangle(innerbrush, innerrect) innerbrush.dispose() ' Format the output string. Dim textrect As RectangleF = New RectangleF(innerRect.Left, innerrect.top, _ innerrect.width, innerrect.height) Dim outstringformat As StringFormat = New StringFormat() outstringformat.alignment = StringAlignment.Center outstringformat.linealignment = StringAlignment.Center ' Paint text. Dim textbrush As SolidBrush = New SolidBrush(Color.White) gr.drawstring(e.hint, e.appearance.font, textbrush, textrect, outstringformat) textbrush.dispose() ' Prohibit default hint painting e.handled = True End Sub 2013 DevExpress Inc. 3576

14 How to: Custom Paint Links 3577 Show Me The complete sample project is available in the DevExpress Code Central database at ww.devexpress.com/ example=e4128. Depending on the target platform type (ASP.NET, W informs, etc), you can either run this example online or dow nload an auto-executable sample. The follow ing sample code handles the NavBarControl.CustomDraw Link event to custom paint links. Links are painted differently in the hot tracked and pressed states. The image below show s a custom painted hot tracked link: (Form1.cs) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; using DevExpress.XtraNavBar.ViewInfo; using DevExpress.XtraNavBar; using DevExpress.Utils.Drawing; namespace NavBarSample { public partial class Form1 : Form { public Form1() { InitializeComponent(); private void navbarcontrol1_customdrawlink(object sender, DevExpress.XtraNavBar.ViewInfo.Custom if (e.objectinfo.state == ObjectState.Hot e.objectinfo.state == ObjectState.Pressed) { LinearGradientBrush brush; NavLinkInfoArgs linkinfo = e.objectinfo as NavLinkInfoArgs; if (e.objectinfo.state == ObjectState.Hot) { 2013 DevExpress Inc. 3577

15 3578 brush = new LinearGradientBrush(e.RealBounds, Color.Orange, Color.PeachPuff, LinearGradientMode.Horizontal); else brush = new LinearGradientBrush(e.RealBounds, Color.PeachPuff, Color.Orange, LinearGradientMode.Horizontal); e.graphics.fillrectangle(brushes.orangered, e.realbounds); Rectangle rect = e.realbounds; rect.inflate(-1, -1); e.graphics.fillrectangle(brush, rect); if (e.image!= null) { Rectangle imagerect = linkinfo.imagerectangle; imagerect.x += (imagerect.width - e.image.width) / 2; imagerect.y += (imagerect.height - e.image.height) / 2; imagerect.size = e.image.size; e.graphics.drawimageunscaled(e.image, imagerect); e.appearance.drawstring(e.cache, e.caption, linkinfo.realcaptionrectangle, Brushes.Whit e.handled = true; (Form1.vb) Imports Microsoft.VisualBasic Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Linq Imports System.Text Imports System.Windows.Forms Imports System.Drawing.Drawing2D Imports DevExpress.XtraNavBar.ViewInfo Imports DevExpress.XtraNavBar Imports DevExpress.Utils.Drawing Namespace NavBarSample Partial Public Class Form1 Inherits Form Public Sub New() InitializeComponent() End Sub Private Sub navbarcontrol1_customdrawlink(byval sender As Object, ByVal e As DevExpress.XtraNavB If e.objectinfo.state = ObjectState.Hot OrElse e.objectinfo.state = ObjectState.Pressed The Dim brush As LinearGradientBrush Dim linkinfo As NavLinkInfoArgs = TryCast(e.ObjectInfo, NavLinkInfoArgs) If e.objectinfo.state = ObjectState.Hot Then brush = New LinearGradientBrush(e.RealBounds, Color.Orange, Color.PeachPuff, Linear Else brush = New LinearGradientBrush(e.RealBounds, Color.PeachPuff, Color.Orange, Linear End If e.graphics.fillrectangle(brushes.orangered, e.realbounds) Dim rect As Rectangle = e.realbounds rect.inflate(-1, -1) e.graphics.fillrectangle(brush, rect) If e.image IsNot Nothing Then Dim imagerect As Rectangle = linkinfo.imagerectangle imagerect.x += (imagerect.width - e.image.width) / DevExpress Inc. 3578

16 3579 imagerect.y += (imagerect.height - e.image.height) / 2 imagerect.size = e.image.size e.graphics.drawimageunscaled(e.image, imagerect) End If e.appearance.drawstring(e.cache, e.caption, linkinfo.realcaptionrectangle, Brushes.Whit e.handled = True End If End Sub End Class End Namespace 2013 DevExpress Inc. 3579

17 How to: Custom Paint the Control's Background 3580 The follow ing sample code handles the NavBarControl.CustomDraw Background event to fill the XtraNavBarControl's background w ith a linear gradient brush and draw a string at the bottom. The image below show s the result. using System.Drawing; using System.Drawing.Drawing2D; using DevExpress.XtraNavBar.ViewInfo; private void navbarcontrol1_customdrawbackground(object sender, CustomDrawObjectEventArgs e) { Rectangle rect = e.realbounds; Graphics gr = e.objectinfo.graphics; // creating a brush and filling the background with it LinearGradientBrush backbrush = new LinearGradientBrush(rect, Color.Pink, Color.LightSkyBlue, LinearGradientMode.Horizontal); gr.fillrectangle(backbrush, rect); // creating a new font for the string Font stringfont = new Font("Verdana", 8); // creating a brush used to draw the string LinearGradientBrush stringbrush = new LinearGradientBrush(rect, Color.Blue, Color.Red, LinearGradientMode.Horizontal); // calculating string rectangle int stringheight = Convert.ToInt16(gr.MeasureString(" stringfont).height); Rectangle stringrect = new Rectangle(rect.Left, rect.bottom - stringheight, rect.width, stringheight); // formatting string output StringFormat outstringformat = new StringFormat(); outstringformat.alignment = StringAlignment.Center; // drawing the string gr.drawstring(" stringfont, stringbrush, stringrect, outstringformat); // prohibiting default background painting e.handled = true; Imports System.Drawing.Drawing2D Imports DevExpress.XtraNavBar.ViewInfo Private Sub NavBarControl1_CustomDrawBackground(ByVal sender As Object, _ ByVal e As CustomDrawObjectEventArgs) Handles NavBarControl1.CustomDrawBackground Dim Rect As Rectangle = e.realbounds Dim Gr As Graphics = e.objectinfo.graphics 2013 DevExpress Inc. 3580

18 3581 ' creating a brush and filling the background with it Dim BackBrush As New LinearGradientBrush(Rect, Color.Pink, Color.LightSkyBlue, _ LinearGradientMode.Horizontal) Gr.FillRectangle(BackBrush, Rect) ' creating a new font for the string Dim StringFont As New Font("Verdana", 8) ' creating a brush used to draw the string Dim StringBrush As New LinearGradientBrush(Rect, Color.Blue, Color.Red, _ LinearGradientMode.Horizontal) ' calculating string rectangle Dim StringHeight = Gr.MeasureString(" StringFont).Height Dim StringRect As New RectangleF(Rect.Left, Rect.Bottom - StringHeight, Rect.Width, _ StringHeight) ' formatting string output Dim OutStringFormat As New StringFormat() OutStringFormat.Alignment = StringAlignment.Center ' drawing the string Gr.DrawString(" StringFont, StringBrush, StringRect, OutStringFormat) ' prohibiting default background painting e.handled = True End Sub 2013 DevExpress Inc. 3581

19 How to: Custom Paint the Group's Client Background 3582 The follow ing sample code handles the NavBarControl.CustomDraw GroupClientBackground event to fill the top and bottom portions of a group's client background with linear gradient brushes of opposing color. The image below show s the result. using System.Drawing.Drawing2D; using DevExpress.XtraNavBar.ViewInfo; private void navbarcontrol1_customdrawgroupclientbackground(object sender, CustomDrawObjectEventArgs e) { // calculating the top and bottom part rectangles Rectangle rect = e.realbounds; int halfheight = rect.height / 2; Rectangle toprect = new Rectangle(rect.Left, rect.top, rect.width, halfheight); Rectangle bottomrect = new Rectangle(rect.Left, rect.top + halfheight, rect.width, halfheight); // creating brushes for the top and bottom parts Color outercolor = Color.White; Color innercolor = Color.LightSkyBlue; LinearGradientBrush topbrush = new LinearGradientBrush(topRect, outercolor, innercolor, LinearGradientMode.Vertical); LinearGradientBrush bottombrush = new LinearGradientBrush(bottomRect, innercolor, outercolor, LinearGradientMode.Vertical); // filling the top and bottom rectangles with the created brushes e.graphics.fillrectangle(topbrush, toprect); e.graphics.fillrectangle(bottombrush, bottomrect); // prohibiting default painting e.handled = true; Imports System.Drawing.Drawing2D Imports DevExpress.XtraNavBar.ViewInfo Private Sub NavBarControl1_CustomDrawGroupClientBackground(ByVal sender As Object, _ ByVal e As CustomDrawObjectEventArgs) Handles NavBarControl1.CustomDrawGroupClientBackground ' calculating the top and bottom part rectangles Dim Rect As Rectangle = e.realbounds Dim HalfHeight = Rect.Height / 2 Dim TopRect As New Rectangle(Rect.Left, Rect.Top, Rect.Width, HalfHeight) Dim BottomRect As New Rectangle(Rect.Left, Rect.Top + HalfHeight, Rect.Width, HalfHeight) ' creating brushes for the top and bottom parts Dim OuterColor As Color = Color.White Dim InnerColor As Color = Color.LightSkyBlue Dim TopBrush As New LinearGradientBrush(TopRect, OuterColor, InnerColor, _ LinearGradientMode.Vertical) Dim BottomBrush As New LinearGradientBrush(BottomRect, InnerColor, OuterColor, _ LinearGradientMode.Vertical) ' filling the top and bottom rectangles with the created brushes 2013 DevExpress Inc. 3582

20 3583 e.graphics.fillrectangle(topbrush, TopRect) e.graphics.fillrectangle(bottombrush, BottomRect) ' prohibiting default painting e.handled = True End Sub 2013 DevExpress Inc. 3583

21 How to: Custom Paint the Group's Client Foreground 3584 The follow ing sample code handles the NavBarControl.CustomDraw GroupClientForeground event to custom paint the text on a group's client foreground. The group doesn't contain any links initially and thus the NavBarGroup. CalcGroupClientHeight event is handled to specify the group's height. The image below show s the result. using DevExpress.XtraNavBar.ViewInfo; using DevExpress.XtraNavBar; private void navbarcontrol1_customdrawgroupclientforeground(object sender, CustomDrawObjectEventArgs e) { // Identifying the processed group. NavGroupClientInfoArgs info = e.objectinfo as NavGroupClientInfoArgs; if (info.group.caption!= "Support Info") return; // Specifying the text rectangle. Rectangle rect = e.realbounds; rect.height /= 4; // Creating a brush object. SolidBrush textbrush = new SolidBrush(Color.Black); // Formatting the output string. StringFormat outstringformat = new StringFormat(); outstringformat.alignment = StringAlignment.Near; outstringformat.linealignment = StringAlignment.Center; // Painting the first string. rect.offset(0, rect.height); using(textbrush) { e.graphics.drawstring(" ", new Font("Verdana", 8, FontStyle.Bold), textbrush, rect, outstringformat); // Painting the second string. rect.offset(0, rect.height); e.graphics.drawstring("support@devexpress.com", new Font("Verdana", 8), textbrush, rect, outstringformat); // Prohibiting default painting. e.handled = true; private void navbargroup2_calcgroupclientheight(object sender, NavBarCalcGroupClientHeightEventArgs e) { e.height = 70; Imports DevExpress.XtraNavBar.ViewInfo Imports DevExpress.XtraNavBar Private Sub NavBarControl1_CustomDrawGroupClientForeground(ByVal sender As Object, _ 2013 DevExpress Inc. 3584

22 3585 ByVal e As CustomDrawObjectEventArgs) _ Handles NavBarControl1.CustomDrawGroupClientForeground ' Identifying the processed group. Dim info As NavGroupClientInfoArgs = CType(e.ObjectInfo, NavGroupClientInfoArgs) If info.group.caption <> "Support Info" Then Exit Sub ' Specifying the text rectangle. Dim Rect As New RectangleF(e.RealBounds.Left, e.realbounds.top, _ e.realbounds.width, e.realbounds.height) Rect.Height /= 4 ' Creating a brush object. Dim TextBrush As New SolidBrush(Color.Black) ' Formatting the output string. Dim OutStringFormat As New StringFormat() OutStringFormat.Alignment = StringAlignment.Near OutStringFormat.LineAlignment = StringAlignment.Center ' Painting the first string. Rect.Offset(0, Rect.Height) e.graphics.drawstring(" ", New Font("Verdana", 8, FontStyle.Bold), TextBrush, _ Rect, OutStringFormat) ' Painting the second string. Rect.Offset(0, Rect.Height) e.graphics.drawstring("support@devexpress.com", New Font("Verdana", 8), TextBrush, _ Rect, OutStringFormat) TextBrush.Dispose() ' Prohibiting default painting. e.handled = True End Sub Private Sub NavBarGroup2_CalcGroupClientHeight(ByVal sender As System.Object, _ ByVal e As NavBarCalcGroupClientHeightEventArgs) Handles NavBarGroup6.CalcGroupClientHeight e.height = 70 End Sub 2013 DevExpress Inc. 3585

23 How to: Customize Display Information via Custom Draw Events 3586 This example illustrates tw o approaches to custom drawing: Performing complete element painting. The NavBarControl.CustomDrawBackground is used to manually draw a string at the bottom of a NavBarControl. To prevent the element's default painting from being performed, the event's CustomDrawObjectEventArgs.Handled parameter is set to true. Customizing the display information of elements. The NavBarControl.CustomDrawLink event is used to change a hot tracked link's font settings, and then the default painting procedure is invoked. The follow ing image shows the result. using System.Drawing.Drawing2D; using DevExpress.XtraNavBar.ViewInfo; using DevExpress.Utils.Drawing; private void navbarcontrol1_customdrawbackground(object sender, CustomDrawObjectEventArgs e) { Rectangle rect = e.realbounds; Graphics gr = e.objectinfo.graphics; // Create a new font for the string. Font stringfont = new Font("Verdana", 8); // Create a brush used to draw the string. LinearGradientBrush stringbrush = new LinearGradientBrush(rect, Color.Blue, Color.Red, LinearGradientMode.Horizontal); // Calculate string rectangle. int stringheight = Convert.ToInt16(gr.MeasureString(" stringfont).height); Rectangle stringrect = new Rectangle(rect.Left, rect.bottom - stringheight, rect.width, stringheight); // Format string output. StringFormat outstringformat = new StringFormat(); outstringformat.alignment = StringAlignment.Center; // Draw the string. gr.drawstring(" stringfont, stringbrush, stringrect, outstringformat); // Prohibit default background painting e.handled = true; private void navbarcontrol1_customdrawlink(object sender, CustomDrawNavBarElementEventArgs e) { // If a link is not hot tracked or pressed it is drawn in the normal way. if (e.objectinfo.state == ObjectState.Hot e.objectinfo.state == ObjectState.Pressed) { NavLinkInfoArgs linkinfo = e.objectinfo as NavLinkInfoArgs; // Create a new font for the string. e.appearance.font = new Font(e.Appearance.Font, FontStyle.Bold); 2013 DevExpress Inc. 3586

24 3587 Private Sub navbarcontrol1_customdrawbackground(byval sender As Object, ByVal e As _ CustomDrawObjectEventArgs) Handles navbarcontrol1.customdrawbackground Dim rect As Rectangle = e.realbounds Dim gr As Graphics = e.objectinfo.graphics ' Create a new font for the string. Dim stringfont As New Font("Verdana", 8) ' Create a brush used to draw the string. Dim stringbrush As New LinearGradientBrush(rect, Color.Blue, Color.Red, _ LinearGradientMode.Horizontal) ' Calculate string rectangle. Dim stringheight As Integer = Convert.ToInt16(gr.MeasureString(" _ stringfont).height) Dim stringrect As New Rectangle(rect.Left, rect.bottom - stringheight, rect.width, _ stringheight) ' Format string output. Dim outstringformat As New StringFormat() outstringformat.alignment = StringAlignment.Center ' Draw the string. gr.drawstring(" stringfont, stringbrush, stringrect, outstringformat) ' Prohibit default background painting e.handled = True End Sub Private Sub navbarcontrol1_customdrawlink(byval sender As Object, ByVal e As _ CustomDrawNavBarElementEventArgs) Handles navbarcontrol1.customdrawlink ' If a link is not hot tracked or pressed it is drawn in the normal way. If e.objectinfo.state = ObjectState.Hot OrElse e.objectinfo.state = ObjectState.Pressed Then Dim linkinfo As NavLinkInfoArgs = TryCast(e.ObjectInfo, NavLinkInfoArgs) ' Create a new font for the string. e.appearance.font = New Font(e.Appearance.Font, FontStyle.Bold) End If End Sub 2013 DevExpress Inc. 3587

25 How to: Iterate Through Available Paint Styles 3588 The follow ing sample code applies all available paint style to the NavBarControl sequentially. A message box is displayed after each style is applied. The NavBarControl.AvailableNavBarViews property is used to obtain the list of View s available for the control. Each View is applied to the control via the NavBarControl.View property. using DevExpress.XtraNavBar.ViewInfo; //... for (int i = 0; i < navbarcontrol1.availablenavbarviews.count; i++) { BaseViewInfoRegistrator vir = navbarcontrol1.availablenavbarviews[i] as BaseViewInfoRegistrator; navbarcontrol1.view = vir; MessageBox.Show("The " + vir.viewname + " painting style.", "Information"); Imports DevExpress.XtraNavBar.ViewInfo '... Dim I As Integer For I = 0 To NavBarControl1.AvailableNavBarViews.Count - 1 Dim vir As BaseViewInfoRegistrator = NavBarControl1.AvailableNavBarViews(I) NavBarControl1.View = vir MessageBox.Show("The " + vir.viewname + " painting style.", "Information") Next 2013 DevExpress Inc. 3588

26 Layout How to: Activate a Group 3589 The follow ing sample code obtains the index of the active group. If the active group is not the first w ithin the collection, the first group becomes active. Note: this example only w orks for those control paint styles which allow only a single expanded group at a time. int activegroupindex = navbarcontrol1.groups.indexof(navbarcontrol1.activegroup); if (activegroupindex!= 0) navbarcontrol1.activegroup = navbarcontrol1.groups[0]; Dim ActiveGroupIndex = NavBarControl1.Groups.IndexOf(NavBarControl1.ActiveGroup) If ActiveGroupIndex <> 0 Then NavBarControl1.ActiveGroup = NavBarControl1.Groups(0) End If 2013 DevExpress Inc. 3589

27 How to: Adjust Group's Drag and Drop Options 3590 The follow ing sample code adjusts drag & drop options of the first group w ithin the control. It enables dragging of this group's links and disables dropping links from other controls into this group. The NavBarGroup.DragDropFlags property is used for this purpose. using DevExpress.XtraNavBar; //... navbarcontrol1.groups[0].dragdropflags &= ~NavBarDragDrop.AllowOuterDrop; navbarcontrol1.groups[0].dragdropflags = NavBarDragDrop.AllowDrag; Imports DevExpress.XtraNavBar '... With NavBarControl1.Groups(0).DragDropFlags =.DragDropFlags And Not NavBarDragDrop.AllowOuterDrop.DragDropFlags =.DragDropFlags Or NavBarDragDrop.AllowDrag End With 2013 DevExpress Inc. 3590

28 How to: Adjust the Control's Drag and Drop Options 3591 the following sample code uses the NavBarControl.DragDropFlags property to modify the control's drag and drop options. It prohibits dropping items from the same control and allow s you to drop items from other NavBarControl. using DevExpress.XtraNavBar; //... navbarcontrol1.dragdropflags &= ~NavBarDragDrop.AllowDrop; navbarcontrol1.dragdropflags = NavBarDragDrop.AllowOuterDrop; Imports DevExpress.XtraNavBar '... With NavBarControl1.DragDropFlags =.DragDropFlags And Not NavBarDragDrop.AllowDrop.DragDropFlags =.DragDropFlags Or NavBarDragDrop.AllowOuterDrop End With 2013 DevExpress Inc. 3591

29 How to: Create a NavBar Control in Code 3592 The follow ing code shows how to create a NavBarControl in code. One group (Local) is added to the control containing three commands ("Inbox", "Outbox" and "Sent Items"). In the example, NavBarItem objects are created to represent the required commands. Their NavElement.Caption properties are initialized appropriately. These specify the display text for the items. It's assumed that small images for NavBar items are stored in the component. To use these images, the is assigned to the NavBarControl.SmallImages property. Then images from the list are associated with specific NavBar items via the item's NavElement.SmallImageIndex property. The NavBarControl.BeginUpdate and NavBarControl.EndUpdate methods are used to prevent excessive updates when mutiple control's properties are modified. The image below show s the result: using DevExpress.XtraNavBar; private void Form1_Load(object sender, EventArgs e) { // Create a NavBarControl. NavBarControl navbar = new NavBarControl(); this.controls.add(navbar); navbar.dock = DockStyle.Fill; // Apply the "SkinExplorerBarView" style. navbar.paintstylename = "SkinExplorerBarView"; // Assign the list that stores small images to the control. navbar.smallimages = imagelist1; // Create a Local group. NavBarGroup grouplocal = new NavBarGroup("Local"); // Create an Inbox item and assign an image from the SmallImages list to the item. NavBarItem iteminbox = new NavBarItem("Inbox"); iteminbox.smallimageindex = 0; // Create an Outbox item. NavBarItem itemoutbox = new NavBarItem("Outbox"); itemoutbox.smallimageindex = 1; // Create a disabled Sent Items item. NavBarItem itemsentitems = new NavBarItem("Sent Items"); itemsentitems.smallimageindex = 2; itemsentitems.enabled = false; // Add the created items to the group and the group to the NavBarControl. // Prevent excessive updates using the BeginUpdate and EndUpdate methods. navbar.beginupdate(); navbar.groups.add(grouplocal); grouplocal.itemlinks.add(iteminbox); grouplocal.itemlinks.add(itemoutbox); grouplocal.itemlinks.add(itemsentitems); grouplocal.expanded = true; navbar.endupdate(); // Specify the event handler which will be invoked when any link is clicked. navbar.linkclicked += new NavBarLinkEventHandler(navBar_LinkClicked); void navbar_linkclicked(object sender, NavBarLinkEventArgs e) { MessageBox.Show(string.Format("The {0 link has been clicked", e.link.caption)); 2013 DevExpress Inc. 3592

30 3593 Imports DevExpress.XtraNavBar Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load ' Create a NavBarControl. Dim navbar As NavBarControl = New NavBarControl() Me.Controls.Add(navBar) navbar.dock = DockStyle.Fill ' Apply the "SkinExplorerBarView" style. navbar.paintstylename = "SkinExplorerBarView" ' Assign the list that stores small images to the control. navbar.smallimages = imagelist1 ' Create a Local group. Dim grouplocal As NavBarGroup = New NavBarGroup("Local") ' Create an Inbox item and assign an image from the SmallImages list to the item. Dim iteminbox As NavBarItem = New NavBarItem("Inbox") iteminbox.smallimageindex = 0 ' Create an Outbox item. Dim itemoutbox As NavBarItem = New NavBarItem("Outbox") itemoutbox.smallimageindex = 1 ' Create a disabled Sent Items item. Dim itemsentitems As NavBarItem = New NavBarItem("Sent Items") itemsentitems.smallimageindex = 2 itemsentitems.enabled = False ' Add the created items to the group and the group to the NavBarControl. ' Prevent excessive updates using the BeginUpdate and EndUpdate methods. navbar.beginupdate() navbar.groups.add(grouplocal) grouplocal.itemlinks.add(iteminbox) grouplocal.itemlinks.add(itemoutbox) grouplocal.itemlinks.add(itemsentitems) grouplocal.expanded = True navbar.endupdate() ' Specify the event handler which will be invoked when any link is clicked. AddHandler navbar.linkclicked, AddressOf navbar_linkclicked End Sub Private Sub navbar_linkclicked(byval sender As System.Object, ByVal e As NavBarLinkEventArgs) MessageBox.Show(String.Format("The {0 link has been clicked", e.link.caption)) End Sub 2013 DevExpress Inc. 3593

31 How to: Create Groups and Items 3594 The follow ing sample code demonstrates how to add and modify groups, items and links between them. All elements are added via the Add method of the corresponding collection. Captions are assigned to the added group and two items. This is performed via the NavElement.Caption property of the NavBarGroup and NavBarItem objects respectively. The NavElement.SmallImage property is used to display images within links. The follow ing image displays the control before and after code execution. using DevExpress.XtraNavBar; //... // adding and adjusting a new group NavBarGroup helpgroup = navbarcontrol1.groups.add(); helpgroup.caption = "Help Topics"; helpgroup.linksusesmallimage = true; // adding and adjusting two items NavBarItem indexitem = navbarcontrol1.items.add(); indexitem.caption = "Index"; indexitem.smallimage = Image.FromFile("E:\\Images\\Icons\\index.bmp"); NavBarItem contentsitem = navbarcontrol1.items.add(); contentsitem.caption = "Contents"; contentsitem.smallimage = Image.FromFile("E:\\Images\\Icons\\bookclosed.bmp"); // creating links between the group and items helpgroup.itemlinks.add(indexitem); helpgroup.itemlinks.add(contentsitem); Imports DevExpress.XtraNavBar '... ' adding and adjusting a new group Dim HelpGroup As NavBarGroup = NavBarControl1.Groups.Add HelpGroup.Caption = "Help Topics" HelpGroup.LinksUseSmallImage = True ' adding and adjusting two items Dim IndexItem As NavBarItem = NavBarControl1.Items.Add IndexItem.Caption = "Index" IndexItem.SmallImage = Image.FromFile("E:\Images\Icons\index.bmp") Dim ContentsItem As NavBarItem = NavBarControl1.Items.Add ContentsItem.Caption = "Contents" 2013 DevExpress Inc. 3594

32 3595 ContentsItem.SmallImage = Image.FromFile("E:\Images\Icons\bookclosed.bmp") ' creating links between the group and items HelpGroup.ItemLinks.Add(IndexItem) HelpGroup.ItemLinks.Add(ContentsItem) 2013 DevExpress Inc. 3595

33 How to: Expand and Collapse Groups 3596 The follow ing sample code toggles a group's expansion state via the NavBarGroup.Expanded property. Individual groups are accessed via the NavBarControl.Groups property. using DevExpress.XtraNavBar; //... for (int i = 0; i < navbarcontrol1.groups.count; i++) { NavBarGroup currgroup = navbarcontrol1.groups[i]; currgroup.expanded =!currgroup.expanded; Imports DevExpress.XtraNavBar '... Dim I As Integer For I = 0 To NavBarControl1.Groups.Count - 1 Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(I) CurrGroup.Expanded = Not CurrGroup.Expanded Next 2013 DevExpress Inc. 3596

34 How to: Hide a NavBar's Item 3597 The follow ing sample code hides the item w hich corresponds to the second link of the second group. Note that if an item is hidden, all corresponding links become invisible. The example below displays a NavBarControl control before and after sample code execution. Note that hiding an item results in hiding two links. using DevExpress.XtraNavBar; //... NavBarGroup group = navbarcontrol1.groups[1]; NavBarItem item = group.itemlinks[1].item; item.visible = false; Imports DevExpress.XtraNavBar '... Dim Group As NavBarGroup = NavBarControl1.Groups(1) Dim Item As NavBarItem = Group.ItemLinks(1).Item Item.Visible = False 2013 DevExpress Inc. 3597

35 How to: Iterate over NavBarControl Items 3598 The follow ing sample code shows you how to iterate over NavBarControl items via the NavBarControl.Items property. using DevExpress.XtraNavBar; //... for (int i = 0; i < navbarcontrol1.items.count; i++) { NavBarItem item = navbarcontrol1.items[i]; // perform some operations on an item here //... Imports DevExpress.XtraNavBar '... Dim I As Integer For I = 0 To NavBarControl1.Items.Count - 1 Dim Item As NavBarItem = NavBarControl1.Items(I) ' perform some operations on an item here '... Next 2013 DevExpress Inc. 3598

36 How to: Iterate Through Groups and Links of Each Group 3599 The follow ing sample code demonstrates how to iterate through groups and item links. The group collection is accessed via the NavBarControl.Groups property. Links are accessed via the group's NavBarGroup.ItemLinks property. using DevExpress.XtraNavBar; //... for (int i = 0; i < navbarcontrol1.groups.count; i++) { NavBarGroup currgroup = navbarcontrol1.groups[i]; // perform some operations on a group here //... for (int j = 0; j < currgroup.itemlinks.count; j++) { NavBarItemLink currlink = currgroup.itemlinks[j]; // perform some operations on a link here //... Imports DevExpress.XtraNavBar '... Dim I, J As Integer For I = 0 To NavBarControl1.Groups.Count - 1 Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(I) ' perform some operations on a group here '... For J = 0 To CurrGroup.ItemLinks.Count - 1 Dim CurrLink As NavBarItemLink = CurrGroup.ItemLinks(J) ' perform some operations on a link here '... Next Next 2013 DevExpress Inc. 3599

37 How to: Keep Links Sorted 3600 The NavLinkCollection.SortByCaption method allow s you to sort a NavBar group's links by their captions. The following code shows how to maintain sort order w hen new links are added to groups. The CollectionChanged event of a group's NavBarGroup.ItemLinks collection allows you to respond to the link collection changing. Note: this event is not raised w hen a link's caption is changed. So, the sorting routine w ill not be called in this case. using DevExpress.XtraNavBar; //... //Subscribe to the CollectionChanged events for all the navbar's groups private void Form1_Load(object sender, System.EventArgs e) { for(int i = 0; i < navbarcontrol1.groups.count; i++) navbarcontrol1.groups[i].itemlinks.collectionchanged += new CollectionChangeEventHandler(ItemLinks_CollectionChanged); public void ItemLinks_CollectionChanged(object sender, CollectionChangeEventArgs e) { if(e.action == CollectionChangeAction.Add) { NavLinkCollection collection = sender as NavLinkCollection; collection.sortbycaption(); Imports System.ComponentModel Imports DevExpress.XtraNavBar '... 'Subscribe to the CollectionChanged events for all the navbar's groups Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load Dim i As Integer For i = 0 To NavBarControl1.Groups.Count - 1 AddHandler NavBarControl1.Groups(i).ItemLinks.CollectionChanged, _ New CollectionChangeEventHandler(AddressOf ItemLinks_CollectionChanged) Next End Sub Public Sub ItemLinks_CollectionChanged(ByVal sender As Object, _ ByVal e As CollectionChangeEventArgs) If e.action = CollectionChangeAction.Add Then Dim collection As NavLinkCollection = sender collection.sortbycaption() End If End Sub 2013 DevExpress Inc. 3600

38 How to: Prohibit Dropping to a Group 3601 The sample code below represents a NavBarControl.NavDragOver event handler. The event handler prohibits dropping to all but the the last item in the group. The target group is identified via the NavBarDragDropEventArgs. Group property of the event's parameter. The dropping position is obtained via the NavBarDragDropEventArgs. InsertPosition property. using DevExpress.XtraNavBar; using DevExpress.XtraNavBar.ViewInfo; private void navbarcontrol1_navdragover(object sender, NavBarDragDropEventArgs e) { NavBarGroup targetgroup = e.group; if (e.insertposition!= targetgroup.visibleitemlinks.count) { e.effect = DragDropEffects.None; Imports DevExpress.XtraNavBar Imports DevExpress.XtraNavBar.ViewInfo Private Sub NavBarControl1_NavDragOver(ByVal sender As Object, _ ByVal e As NavBarDragDropEventArgs) Handles NavBarControl1.NavDragOver Dim TargetGroup As NavBarGroup = e.group If e.insertposition <> TargetGroup.VisibleItemLinks.Count Then e.effect = DragDropEffects.None End If End Sub 2013 DevExpress Inc. 3601

39 How to: Embed a DateControl into a Group 3602 The follow ing sample code embeds a DateControl into a NavBarControl's group. To allow control embedding, the NavBarGroup.GroupStyle property is set to ControlContainer. Then, the DateControl is added to the group via the NavBarGroup.ControlContainer property. The image below show s the result. DevExpress.XtraEditors.DateControl dc = new DevExpress.XtraEditors.DateControl(); navbargroup1.groupstyle = DevExpress.XtraNavBar.NavBarGroupStyle.ControlContainer; navbargroup1.controlcontainer.controls.add(dc); navbargroup1.groupclientheight = dc.height + 3; navbarcontrol1.width = dc.width + 3; Dim dc As New DevExpress.XtraEditors.DateControl() navbargroup1.groupstyle = DevExpress.XtraNavBar.NavBarGroupStyle.ControlContainer navbargroup1.controlcontainer.controls.add(dc) navbargroup1.groupclientheight = dc.height + 3 navbarcontrol1.width = dc.width DevExpress Inc. 3602

40 Miscellaneous How to: Assign Hints to the NavBarControl's Groups 3603 The follow ing sample code assigns hints to all groups of the NavBarControl control. This is performed via the NavElement.Hint property of NavBarGroup objects. Group captions are assigned as hint text. The NavBarControl.ShowGroupHint property is set to true to enable displaying of group hints. Review the image below for an example of code execution results. using DevExpress.XtraNavBar; //... for (int i = 0; i < navbarcontrol1.groups.count; i++) { NavBarGroup currgroup = navbarcontrol1.groups[i]; currgroup.hint = currgroup.caption; navbarcontrol1.showgrouphint = true; Imports DevExpress.XtraNavBar '... Dim I As Integer For I = 0 To NavBarControl1.Groups.Count - 1 Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(I) CurrGroup.Hint = CurrGroup.Caption Next NavBarControl1.ShowGroupHint = True 2013 DevExpress Inc. 3603

41 How to: Assign Hints to the NavBarControl's Items 3604 The follow ing sample code assigns hints to all items of the NavBarControl. This is performed via the NavElement. Hint property of NavBarItem objects. Item captions are assigned as hint text. The NavBarControl.ShowLinkHint property is set to true to enable displaying link hints. Review the image below for an example of code execution results. using DevExpress.XtraNavBar; //... for (int i = 0; i < navbarcontrol1.items.count; i++) { NavBarItem curritem = navbarcontrol1.items[i]; curritem.hint = curritem.caption; navbarcontrol1.showlinkhint = true; Dim I As Integer For I = 0 To NavBarControl1.Items.Count - 1 Dim CurrItem As NavBarItem = NavBarControl1.Items(I) CurrItem.Hint = CurrItem.Caption Next NavBarControl1.ShowLinkHint = True 2013 DevExpress Inc. 3604

Examples. Products. WinForms Controls > Products > Tree List > Examples

Examples. Products. WinForms Controls > Products > Tree List > Examples Examples 2584 WinForms Controls > Products > Tree List > Examples Please refer to the sections below, for many examples of the corresponding features in use. Data Binding Nodes Data Editing Data Representation

More information

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

(0,0) (600, 400) CS109. PictureBox and Timer Controls

(0,0) (600, 400) CS109. PictureBox and Timer Controls CS109 PictureBox and Timer Controls Let s take a little diversion and discuss how to draw some simple graphics. Graphics are not covered in the book, so you ll have to use these notes (or the built-in

More information

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics.

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Additional Controls, Scope, Random Numbers, and Graphics CS109 In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Combo

More information

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox] C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

C4.3, 4 Lab: Conditionals - Select Statement and Additional Input Controls Solutions

C4.3, 4 Lab: Conditionals - Select Statement and Additional Input Controls Solutions C4.3, 4 Lab: Conditionals - Select Statement and Additional Input Controls Solutions Between the comments included with the code and the code itself, you shouldn t have any problems understanding what

More information

End-User Capabilities

End-User Capabilities End-User Capabilities 1951 W informs Controls > Products > Pivot Grid > End-User Capabilities The topics in this section describe the operations available to the end-users of the Pivot Grid. The follow

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Eyes of the Dragon - XNA Part 37 Map Editor Revisited Eyes of the Dragon - XNA Part 37 Map Editor Revisited I'm writing these tutorials for the XNA 4.0 framework. Even though Microsoft has ended support for XNA it still runs on all supported operating systems

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

More information

Instructor s Notes Programming Logic Printing Reports. Programming Logic. Printing Custom Reports

Instructor s Notes Programming Logic Printing Reports. Programming Logic. Printing Custom Reports Instructor s Programming Logic Printing Reports Programming Logic Quick Links & Text References Printing Custom Reports Printing Overview Page 575 Linking Printing Objects No book reference Creating a

More information

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them. We are working on Visual Studio 2010 but this project can be remade in any other version of visual studio. Start a new project in Visual Studio, make this a C# Windows Form Application and name it zombieshooter.

More information

Learning VB.Net. Tutorial 19 Classes and Inheritance

Learning VB.Net. Tutorial 19 Classes and Inheritance Learning VB.Net Tutorial 19 Classes and Inheritance Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient;

More information

Inheriting Windows Forms with Visual C#.NET

Inheriting Windows Forms with Visual C#.NET Inheriting Windows Forms with Visual C#.NET Overview In order to understand the power of OOP, consider, for example, form inheritance, a new feature of.net that lets you create a base form that becomes

More information

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); }

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); } เว บแอพล เคช น using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011 Hands-On Lab Lab: Client Object Model Lab version: 1.0.0 Last updated: 2/23/2011 CONTENTS OVERVIEW... 3 EXERCISE 1: RETRIEVING LISTS... 4 EXERCISE 2: PRINTING A LIST... 8 EXERCISE 3: USING ADO.NET DATA

More information

Chapter 6 Dialogs. Creating a Dialog Style Form

Chapter 6 Dialogs. Creating a Dialog Style Form Chapter 6 Dialogs We all know the importance of dialogs in Windows applications. Dialogs using the.net FCL are very easy to implement if you already know how to use basic controls on forms. A dialog is

More information

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

Chapter 13. Graphics, Animation, Sound and Drag-and-Drop The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 13. Graphics, Animation, Sound and Drag-and-Drop The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 13 Graphics, Animation, Sound and Drag-and-Drop McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives - 1 Use Graphics methods to draw shapes, lines, and filled

More information

Form Properties Window

Form Properties Window C# Tutorial Create a Save The Eggs Item Drop Game in Visual Studio Start Visual Studio, Start a new project. Under the C# language, choose Windows Form Application. Name the project savetheeggs and click

More information

10Tec igrid for.net What's New in the Control

10Tec igrid for.net What's New in the Control v1.70, build 0002 February 8th, 2007 10Tec igrid for.net What's New in the Control 1. [Fixed] When at design-time the developer set the minimal (maximal) width of a column to a value greater (less) than

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

Chapter 12. Tool Strips, Status Strips, and Splitters

Chapter 12. Tool Strips, Status Strips, and Splitters Chapter 12 Tool Strips, Status Strips, and Splitters Tool Strips Usually called tool bars. The new ToolStrip class replaces the older ToolBar class of.net 1.1. Create easily customized, commonly employed

More information

ComponentOne. Word for WinForms

ComponentOne. Word for WinForms ComponentOne Word for WinForms ComponentOne, a division of GrapeCity 201 South Highland Avenue, Third Floor Pittsburgh, PA 15206 USA Website: http://www.componentone.com Sales: sales@componentone.com Telephone:

More information

10Tec igrid for.net 6.0 What's New in the Release

10Tec igrid for.net 6.0 What's New in the Release What s New in igrid.net 6.0-1- 2018-Feb-15 10Tec igrid for.net 6.0 What's New in the Release Tags used to classify changes: [New] a totally new feature; [Change] a change in a member functionality or interactive

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

CS3240 Human-Computer Interaction

CS3240 Human-Computer Interaction CS3240 Human-Computer Interaction Lab Session 3 Supplement Creating a Picture Viewer Silverlight Application Page 1 Introduction This supplementary document is provided as a reference that showcases an

More information

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI;

More information

DRAWING AND MOVING IMAGES

DRAWING AND MOVING IMAGES DRAWING AND MOVING IMAGES Moving images and shapes in a Visual Basic application simply requires the user of a Timer that changes the x- and y-positions every time the Timer ticks. In our first example,

More information

Revision for Final Examination (Second Semester) Grade 9

Revision for Final Examination (Second Semester) Grade 9 Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual

More information

The Gracefulness of the Merging Graph N ** C 4 with Dotnet Framework

The Gracefulness of the Merging Graph N ** C 4 with Dotnet Framework The Gracefulness of the Merging Graph N ** C 4 with Dotnet Framework Solairaju¹, N. Abdul Ali² and R.M. Karthikkeyan 3 1-2 : P.G. & Research Department of Mathematics, Jamal Mohamed College, Trichy 20.

More information

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

Classes in C# namespace classtest { public class myclass { public myclass() { } } } Classes in C# A class is of similar function to our previously used Active X components. The difference between the two is the components are registered with windows and can be shared by different applications,

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project. C# Tutorial - Create a Batman Gravity Run Game Start a new project in visual studio and call it gravityrun It should be a windows form application with C# Click OK Change the size of the to 800,300 and

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using 1 using System; 2 using System.Diagnostics; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using System.Drawing; 7 using System.Text; 8 using System.Windows.Forms;

More information

Lecture 10 OOP and VB.Net

Lecture 10 OOP and VB.Net Lecture 10 OOP and VB.Net Pillars of OOP Objects and Classes Encapsulation Inheritance Polymorphism Abstraction Classes A class is a template for an object. An object will have attributes and properties.

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 16 Visual Basic/C# Programming (330) REGIONAL 2016 Program: Character Stats (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores and answer keys! Property

More information

Unit 3. Lesson Designing User Interface-2. TreeView Control. TreeView Contol

Unit 3. Lesson Designing User Interface-2. TreeView Control. TreeView Contol Designing User Interface-2 Unit 3 Designing User Interface-2 Lesson 3.1-3 TreeView Control A TreeView control is designed to present a list in a hierarchical structure. It is similar to a directory listing.

More information

Chapter 2 Exploration of a Visual Basic.Net Application

Chapter 2 Exploration of a Visual Basic.Net Application Chapter 2 Exploration of a Visual Basic.Net Application We will discuss in this chapter the structure of a typical Visual Basic.Net application and provide you with a simple project that describes the

More information

Course 2DCis: 2D-Computer Graphics with C# Chapter C1: Comments to the Intro Project

Course 2DCis: 2D-Computer Graphics with C# Chapter C1: Comments to the Intro Project 1 Course 2DCis: 2D-Computer Graphics with C# Chapter C1: Comments to the Intro Project Copyright by V. Miszalok, last update: 04-01-2006 using namespaces //The.NET Framework Class Library FCL contains

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

Course 2D_WPF: 2D-Computer Graphics with C# + WPF Chapter C1a: The Intro Project Written in XAML and C#

Course 2D_WPF: 2D-Computer Graphics with C# + WPF Chapter C1a: The Intro Project Written in XAML and C# 1 Course 2D_WPF: 2D-Computer Graphics with C# + WPF Chapter C1a: The Intro Project Written in XAML and C# An Empty Window Copyright by V. Miszalok, last update: 2011-02-08 Guidance for Visual C# 2010 Express,

More information

Activating AspxCodeGen 4.0

Activating AspxCodeGen 4.0 Activating AspxCodeGen 4.0 The first time you open AspxCodeGen 4 Professional Plus edition you will be presented with an activation form as shown in Figure 1. You will not be shown the activation form

More information

XNA 4.0 RPG Tutorials. Part 3. Even More Core Game Components

XNA 4.0 RPG Tutorials. Part 3. Even More Core Game Components XNA 4.0 RPG Tutorials Part 3 Even More Core Game Components I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list

More information

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

XNA 4.0 RPG Tutorials. Part 2. More Core Game Components

XNA 4.0 RPG Tutorials. Part 2. More Core Game Components XNA 4.0 RPG Tutorials Part 2 More Core Game Components I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of

More information

Variables One More (but not the last) Time with feeling

Variables One More (but not the last) Time with feeling 1 One More (but not the last) Time with feeling All variables have the following in common: a name a type ( int, float, ) a value an owner We can describe variables in terms of: who owns them ( Processing

More information

Getting Started with Access

Getting Started with Access MS Access Chapter 2 Getting Started with Access Course Guide 2 Getting Started with Access The Ribbon The strip across the top of the program window that contains groups of commands is a component of the

More information

Visual Basic. Visual Basic. Visual Studio. Developer. Add professional polish to the TabControl with GDI+ by Sheila M. Davis. Inside.

Visual Basic. Visual Basic. Visual Studio. Developer. Add professional polish to the TabControl with GDI+ by Sheila M. Davis. Inside. Volume 14, Number 8 www.elijournals.com Visual Studio Developer Technology and Solutions for Microsoft Visual Studio Developers In this issue Tired of tan, bland tab controls? Give each tab component a

More information

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

string spath; string sedifile = 277_005010X228.X12; string sseffile = 277_005010X228.SemRef.EVAL0.SEF; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

ProvideX. NOMADS Enhancements

ProvideX. NOMADS Enhancements ProvideX VERSION 8.0 NOMADS Enhancements Introduction 3 Panel Designer Enhancements 5 Properties Window 7 New Format Definition for Grids/List Boxes 12 Bulk Edit Utility 14 Drag and Drop Utility 16 Dependency

More information

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button Create an Interest Calculator with C# In This tutorial we will create an interest calculator in Visual Studio using C# programming Language. Programming is all about maths now we don t need to know every

More information

Santiago Canyon College Computer Science

Santiago Canyon College Computer Science P a g e 1 Santiago Canyon College Computer Science The.Net Threading Model Introduction The purpose of this paper is to introduce you to multi-threading in Visual Studio. Learning how to take advantage

More information

Chapter 2 Visual Basic, Controls, and Events. 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual Basic Events

Chapter 2 Visual Basic, Controls, and Events. 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual Basic Events Chapter 2 Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual Basic Events 1 2.1 An Introduction to Visual Basic 2010 Why Windows and Why Visual

More information

End-User Capabilities

End-User Capabilities End-User Capabilities 2391 W informs Controls > Products > Scheduler > End-User Capabilities The topics in this section describe operations available to end-users of the XtraScheduler suite. The following

More information

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects 1 Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects Outline 19.1 Test-Driving the Microwave Oven Application 19.2 Designing the Microwave Oven Application 19.3 Adding a New

More information

SPARK. User Manual Ver ITLAQ Technologies

SPARK. User Manual Ver ITLAQ Technologies SPARK Forms Builder for Office 365 User Manual Ver. 3.5.50.102 0 ITLAQ Technologies www.itlaq.com Table of Contents 1 The Form Designer Workspace... 3 1.1 Form Toolbox... 3 1.1.1 Hiding/ Unhiding/ Minimizing

More information

IMS1906: Business Software Fundamentals Tutorial exercises Week 5: Variables and Constants

IMS1906: Business Software Fundamentals Tutorial exercises Week 5: Variables and Constants IMS1906: Business Software Fundamentals Tutorial exercises Week 5: Variables and Constants These notes are available on the IMS1906 Web site http://www.sims.monash.edu.au Tutorial Sheet 4/Week 5 Please

More information

Custom Control Tutorial

Custom Control Tutorial Custom Control Tutorial Program: Woei-Kae Chen Text/Picture: Spirit Du 24 December, 2013, Ver. 1.0.3 Contents About this Document... 1 Tutorial Creating Custom Control... 2 About this Document In the homework,

More information

ITP 101 Project 2 - Photoshop

ITP 101 Project 2 - Photoshop ITP 101 Project 2 - Photoshop Project Objectives Learn how to use an image editing application to create digital images. We will use Adobe Photoshop for this project. Project Details To continue the development

More information

GUI Design and Event- Driven Programming

GUI Design and Event- Driven Programming 4349Book.fm Page 1 Friday, December 16, 2005 1:33 AM Part 1 GUI Design and Event- Driven Programming This Section: Chapter 1: Getting Started with Visual Basic 2005 Chapter 2: Visual Basic: The Language

More information

UNIT-3. Prepared by R.VINODINI 1

UNIT-3. Prepared by R.VINODINI 1 Prepared by R.VINODINI 1 Prepared by R.VINODINI 2 Prepared by R.VINODINI 3 Prepared by R.VINODINI 4 Prepared by R.VINODINI 5 o o o o Prepared by R.VINODINI 6 Prepared by R.VINODINI 7 Prepared by R.VINODINI

More information

Huw Talliss Data Structures and Variables. Variables

Huw Talliss Data Structures and Variables. Variables Data Structures and Variables Variables The Regex class represents a read-only regular expression. It also contains static methods that allow use of other regular expression classes without explicitly

More information

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDIx64;

More information

Design Of Human Computer Interfaces Assignment 1- Hello World. Compliance Report

Design Of Human Computer Interfaces Assignment 1- Hello World. Compliance Report Design Of Human Computer Interfaces Assignment 1- Hello World Compliance Report Prepared for: Skip Poehlman Prepared By: K C Course: SE 4D03 Date: September 30, 2008 Contents 1. Code Listing a. Module

More information

Client-Side Web Technologies. CSS Part II

Client-Side Web Technologies. CSS Part II Client-Side Web Technologies CSS Part II Topics Box model and related properties Visual formatting model and related properties The CSS Box Model Describes the rectangular boxes generated for elements

More information

Unit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types

Unit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types Managing Data Unit 4 Managing Data Introduction Lesson 4.1 Data types We come across many types of information and data in our daily life. For example, we need to handle data such as name, address, money,

More information

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } using System using System.Collections.Generic using System.ComponentModel using System.Data using System.Drawing using System.Text using System.Windows.Forms using Edidev.FrameworkEDI 1 namespace csharp_gen277x214

More information

A Complete Tutorial for Beginners LIEW VOON KIONG

A Complete Tutorial for Beginners LIEW VOON KIONG I A Complete Tutorial for Beginners LIEW VOON KIONG Disclaimer II Visual Basic 2008 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been

More information

Chapter 13. Graphics, Animation, Sound, and Drag-and-Drop. McGraw-Hill. Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.

Chapter 13. Graphics, Animation, Sound, and Drag-and-Drop. McGraw-Hill. Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 13 Graphics, Animation, Sound, and Drag-and-Drop McGraw-Hill Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. Objectives (1 of 2) Use Graphics methods to draw shapes, lines,

More information

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2 Class Test 4 Marks will be deducted for each of the following: -5 for each class/program that does not contain your name and student number at the top. -2 If program is named anything other than Question1,

More information

Lab 4: Adding a Windows User-Interface

Lab 4: Adding a Windows User-Interface Lab 4: Adding a Windows User-Interface In this lab, you will cover the following topics: Creating a Form for use with Investment objects Writing event-handler code to interact with Investment objects Using

More information

DEVELOPING OBJECT ORIENTED APPLICATIONS

DEVELOPING OBJECT ORIENTED APPLICATIONS DEVELOPING OBJECT ORIENTED APPLICATIONS By now, everybody should be comfortable using form controls, their properties, along with methods and events of the form class. In this unit, we discuss creating

More information

WinForms Charts How to Determine the Chart Element underneath. the Mouse Cursor and Display Series Point s Data in a Tooltip

WinForms Charts How to Determine the Chart Element underneath. the Mouse Cursor and Display Series Point s Data in a Tooltip WinForms Charts How to Determine the Chart Element underneath the Mouse Cursor and Display Series Point s Data in a Tooltip As a developer, sometimes you need to make your application more interactive.

More information

Tutorial 03 understanding controls : buttons, text boxes

Tutorial 03 understanding controls : buttons, text boxes Learning VB.Net Tutorial 03 understanding controls : buttons, text boxes Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple

More information

User Guide for IntegralUI ListBox v3.0

User Guide for IntegralUI ListBox v3.0 User Guide for IntegralUI ListBox v3.0 2013 Lidor Systems. All rights reserved 1 Table of contents Introduction 4 Architecture 5 Object Model 5 Event Model 6 Editor 7 Appearance 8 Working with styles 8

More information

Event-based Programming

Event-based Programming Window-based programming Roger Crawfis Most modern desktop systems are window-based. What location do I use to set this pixel? Non-window based environment Window based environment Window-based GUI s are

More information

โปรแกรมช วยทดสอบหม อแปลงกระแส

โปรแกรมช วยทดสอบหม อแปลงกระแส โปรแกรมช วยทดสอบหม อแปลงกระแส 1.เมน ของโปรแกรม ภาพท 1 หน าเมน ของโปรแกรม Public Class frmmain Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

More information

FOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources

FOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources FOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources This application demonstrates how a DataGridView control can be

More information

Overview of Adobe Fireworks

Overview of Adobe Fireworks Adobe Fireworks Overview of Adobe Fireworks In this guide, you ll learn how to do the following: Work with the Adobe Fireworks workspace: tools, Document windows, menus, and panels. Customize the workspace.

More information

IN CHAPTER 9 we delved into advanced 2D graphics programming. In

IN CHAPTER 9 we delved into advanced 2D graphics programming. In 10 Transformation IN CHAPTER 9 we delved into advanced 2D graphics programming. In this chapter we will explore GDI+ transformations. A transformation is a process that changes graphics objects from one

More information

Responding to the Mouse

Responding to the Mouse Responding to the Mouse The mouse has two buttons: left and right. Each button can be depressed and can be released. Here, for reference are the definitions of three common terms for actions performed

More information

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below. APPENDIX 1 TABLE DETAILS Mainly three tables namely Teacher, Student and Class for small database of a school are used. The snapshots of all three tables are shown below. Details of Class table are shown

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

Tec Company,

Tec Company, 2000-2014 10Tec Company, http://10tec.com/ igrid.net v4.6 Manual -1-2014-Sep-25 Contents CONTENTS... 1 IGRID.NET CORE CONTROL MANUAL... 4 INTRODUCTION TO IGRID.NET...4 IGRID.NET BASICS...4 Populating the

More information

Visual C# Program: Simple Game 3

Visual C# Program: Simple Game 3 C h a p t e r 6C Visual C# Program: Simple Game 3 In this chapter, you will learn how to use the following Visual C# Application functions to World Class standards: Opening Visual C# Editor Beginning a

More information

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky Brian Kiser November 2010 Vigilant C# 2.5 Commonwealth of Kentucky Frankfort, Kentucky Table of Contents 1.0 Work Sample Description Page 3 2.0 Skills Demonstrated 2.1 Software development competency using

More information

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How to Download a File in the Background 15 How to Implement

More information