Saturday, September 25, 2010

Visual Basic to create "five star" level control





Figure 1 "five-star" level control

This control looks great and provides a good graphical way to view the grade, but according to editorial experience, I find it especially cool. When the mouse hover over the bar when, Windows Media Player highlights one of the stars to show you the current float of its value on the bar, thus providing a good graphical feedback. In a variety of Web sites (including Netflix and Amazon), you can find the same type of user interface, and I think in their own applications have this feature, so I decided to create my own control. I'll use Windows Forms controls that the user interface elements to simulate the same time try to make it custom with sufficient capacity to be used in various environments.

Getting Started

The first step is to create a new Class Library project to hold the controls and empty Windows application to a test project. Although the Windows Control Library project template appears to be more appropriate, and it is well to work, but by default, the project includes user controls (user controls 鈹?General for composite control contains one or more controls for Windows Forms control), and I need is an empty class file. Next, you must present a new empty class inherits from the System.Windows.Forms.Control, which simply add a single class declaration can be achieved:

Public Class Ratings
Inherits System.Windows.Forms.Control End Class

If you try to use only IntelliSense? Add Inherits statement, will encounter a small problem: use Class Library template to start your project will not add a reference to the System.Windows.Forms assembly, so you need to manually add. At this point, be the first to add a reference to an System.Drawing.dll, because the final drawing to use custom controls. From now on, I generally follow the following steps to carry out all of the control development:

1. To add custom drawing control standards constructor, set the control style of all the necessary controls in order to correct the drawing and smooth as possible.

Public Sub New ()
Me.SetStyle (ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle (ControlStyles.DoubleBuffer, True)
Me.SetStyle (ControlStyles.ResizeRedraw, True)
Me.SetStyle (ControlStyles.UserPaint, True)
...''Add any additional initialization code here
End Sub

2. Paper record configuration control behavior and appearance may need to list the public properties.

3. All these attributes add to the private member variable (I prefer to use Hungarian notation in front of each variable to add the prefix "m_" to represent the internal variables), and includes the appropriate default values, as shown below.

Private m_FilledImage As Image
Private m_EmptyImage As Image
Private m_HoverImage As Image
Private m_ImageCount As Integer = 5
Private m_TopMargin As Integer = 2
Private m_LeftMargin As Integer = 4
Private m_BottomMargin As Integer = 2
Private m_RightMargin As Integer = 4
Private m_ImageSpacing As Integer = 8
Private m_ImageToDraw As Integer = 1
Private m_SelectedColor As Color = Color.Empty
Private m_HoverColor As Color = Color.Empty
Private m_EmptyColor As Color = Color.Empty
Private m_OutlineColor As Color = Color.Empty

Private m_selectedItem As Integer = 3
Private m_hoverItem As Integer = 1
Private m_hovering As Boolean = False

Private ItemAreas () As Rectangle

4. The properties of these variables into the process, although most of the process is fairly simple (get value, set value), but some of the process will require some additional code, I will discuss later.

5. Began to design and custom graphics code.

6. Finally, add a new event, such as clicking a specific control process or the requirements of the specific event.

The default value of properties with a specific routine

I want some of my properties

鈹?handling those attributes of color

鈹?reflect the control of other properties of the default values (such as ForeColor) and to reflect the user's system color of other values. For example, let us use only one of them can produce color HoverColor to see the default value of different methods.

The first is obvious, just in the variable declaration (or constructor) to set default values:

Private m_HoverColor As Color = _
Color.FromKnownColor (KnownColor.Highlight)

In most cases, this can work well, but there are two problems. The first question is, if the user running the application to change their system colors, how to do? After you restart the program, the control will reflect the correct color, but was not. The second question is, if the user to programmatically set the color to the default colors, how to do? There is no practical way to clear the color settings and set it to the appropriate system color. Users will naturally be set correctly for the appropriate system color, but then will return to first question. Another method is to color changes in the user's system when the traps, and the corresponding changes to your property value:

Protected Overrides Sub OnSystemColorsChanged (_
ByVal e As System.EventArgs)
Me.HoverColor = Color.FromKnownColor (KnownColor.Highlight)
Me.Invalidate ()







相关链接:



OGM to AVI



Art - Screen SAVERS Report



Photoshop plug-in filters



Strawberry Splendor



Bitter Start, the result of joy



ASF to MPG



DivX to IPod



ADO programming in the definition of the problem ENCOUNTERED by ATL



To Yushu in Qinghai Province earthquake in mourning the dead and injured



3DS MAX And Some Basic Materials And Practical Examples Of Parameters



My favorite Graphic Viewers



251 hospitals and Receive Paperless



Articles about Games Arcade



symantec will be extended to the Exchange platform



"Dream Zhu Xian," Common Sense To Make Money: What Equipment The Most Valuable?



Top E-Mail List Management



GGhost A Key Recovery 09.03.08



Thursday, September 16, 2010

The official version of Opera 10 September 1 showing the speed will increase 40%



August 28 News, Opera announced that desktop browser Opera 10 RC official version of the first edition in September 1 for download, the official version of Opera 9.6 with the new version of high-intensive processing resources, such as Gmail and Facebook pages, etc. , will be 40% faster.

Opera company said in response to an increasing number of mobile internet users disturbing network traffic congestion, Opera 10 launch of Opera Turbo function, the limited bandwidth can improve the website speed, so play site has a higher rate of family and play the net efficiency. In addition, the site developers can use the network to enjoy the font, RGBA / HSLA colors and SVG support.

In addition, Opera browser built-in mail software Opera Mail also features a substantial revision and improvement; Opera 10 improved the tabbed browsing feature that allows users to adjust the network to see page thumbnails, and adjusted according to personal preferences making the page size, up and down and left and right position.







Recommended links:



About Groovy and Grails



IME TOOL to input more obedient



E-cology in the Pan Micro Series 27



Popular technique - the production of waterlines banner



The "Page SETUP" Come Right menu



DDOS DDOS Tracking The Introduction And



Ps3 mov



Windows Media Player M4v



video format for ps3



Hot JAVA And JavaScript



"Batman Arkham asylum" after Playing a little bit of getting



youtube On xbox 360



My Favorite Printer



Big Rabbit - Yuan Colombia



Wednesday, July 7, 2010

Professional CD M4A ID3 to APE Maker

Professional CD M4A ID3 to APE Maker supports WAV PCM. Professional CD M4A ID3 to APE Maker supports Compressed WAV (ADPCM, GSM, DSP, A-LAW, U-LAW, ALF2 and others). Support OGG (Ogg Vorbis), G.721, G.723, G.726. Support VOX (Dialogic ADPCM), WMA Windows Media Audio). Support RAW (PCM, A-LAW, U-LAW), CDA (Audio CD Tracks). Need to convert WMA to MP3, or MP3 to WAV, or between other audio file formats? This Audio Converter is what you are looking for! This Audio Converter is a quick and easy-to-use audio converting utility. The program converts between the most popular audio formats, including WMA, WAV, MP3, OGG, AVI/MPEG audio, MPC and more. The software works on all Windows systems. This software quickly and easily converts your audio or video files to AAC, AC3, ID3, M3U, M4A, M4P, MP3 ID3 Tag, OGG, RA, WAV, WMA, MP2, APE, VQF, MPC, AMR, Midi, WAVE, RM format. Convert every single audio formats today!



Recommand Link:



ISofter DVD To Mp4 Converter



avi to M4v



ID3 to APE Recorder



Christmasgift DVD to 3GP



Hope YouTube To IPod 3GP SWF



3gp to avi



Convert Mp4 To Mp3



Simple Network AND Internet



Xingtone Ringtone Maker



convert to WMV



Lenogo DVD Movie to iPod Video Converter



Strategy And War Games Report



Best Help Tools



Sunday, July 4, 2010

Youtube Movie to Flash Tools

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Easily Convert all popular video formats. Provides the highest speed to download YouTube video. Support unlimited simultaneous downloading tasks. Supports auto-name your downloaded video title as the YoutTube page shows. Offers you the most convenient task management and the easiest control capability. About Conversion Features. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Youtube FLV To 3G2 Popular



How do I convert HD to ZEN X-Fi WLAN



Elecard Converter Studio AVC HD Edition



AlltoDVD XviD Converter



Wizard Audio Players



Youtube Movie To MPEG Professional



WorldCup MPEG to AVI



Youtube MOVIE to RMVB Pack



LasVegas DVD to DivX



How do I convert video to IRIVER P35



How do I convert DVD to Cowon S9



Recommend Reference Tools



windows media center



Plato Video To iPod PSP 3GP



Geography Education Guide



Tuesday, June 29, 2010

Youtube FLV to PPC Value

It's most popular and very easy to use YouTube tools. helps you Fast download, convert, play, manage your favorite YouTube videos. If you're a YouTube fan, you'll love YouTube tool! is the most powerful YouTube assistant on the planet. YouTube tool easily: 1. Fast downloads YouTube videos, 2. Supports unlimited simultaneous downloads (a real time saver!), 3. Automatically names the downloaded video the same as the YouTube title, 4. Converts YouTube videos to various video formats, including Video, DVD, VCD, AVI, MPG, MPEG, Divx, Xvid, WMV, RM, RMVB, MOV, MP4, 3GP, SWF, DAT, H264, VOB, Flash, PDA, M4V, 3G2, AMV, CDA, DV,QuickTime, ASX, TV, VHS, FLV, H264, BDMV, MAC, Apple TV, Zune, iPod, PDA, PSP, PS2, PS3, Xbox, Xbox 360, Mobile Phone, Cell Phone, Blackberry, Wii, Laptops, Printers, Palm OS, Pocket PC, PPC, Treo, Psion, EPOC, iphone.
Easily Convert all popular video formats. Provides the highest speed to download YouTube video. Support unlimited simultaneous downloading tasks. Supports auto-name your downloaded video title as the YoutTube page shows. Offers you the most convenient task management and the easiest control capability. About Conversion Features. - is the most powerful YouTube assistant on the planet.

Friday, June 25, 2010

Youtube FLV Save + Player Pro

It's most popular and very easy to use YouTube tools. helps you Fast download, convert, play, manage your favorite YouTube videos. If you're a YouTube fan, you'll love YouTube tool! is the most powerful YouTube assistant on the planet. YouTube tool easily: 1. Fast downloads YouTube videos, 2. Supports unlimited simultaneous downloads (a real time saver!), 3. Automatically names the downloaded video the same as the YouTube title, 4. Converts YouTube videos to various video formats, including Video, DVD, VCD, AVI, MPG, MPEG, Divx, Xvid, WMV, RM, RMVB, MOV, MP4, 3GP, SWF, DAT, H264, VOB, Flash, PDA, M4V, 3G2, AMV, CDA, DV,QuickTime, ASX, TV, VHS, FLV, H264, BDMV, MAC, Apple TV, Zune, iPod, PDA, PSP, PS2, PS3, Xbox, Xbox 360, Mobile Phone, Cell Phone, Blackberry, Wii, Laptops, Printers, Palm OS, Pocket PC, PPC, Treo, Psion, EPOC, iphone.
Supports customize or create user's own profile for any new (portable) device. The video conversion supports preview. About Playing Features. Embedded YouTube Video (Offline) Player is available, it supports offline play YouTube video, .flv video and .swf video. Supports "Drag and Drop" video files direct to the main window. Easy to select the source files. Cool UI skin available. - is the most powerful YouTube assistant on the planet.



Recommand Link:



How to convert DVD to Cowon D2 Plus



!1 Power ID3 Editor



SWIFT DVD to WMV



Screen Savers Specialist



Youtube To RM Plus



Matroska video



Christmas-Idea DVD to RMVB MP4



Convert HD To Sony E436FRED



Christmasgift AVI Converter



Top Shell Tools



PianoBoy- Virtual Piano VST



Youtube FLV to MAC Utility



QUICKONE Video to iPod Converter



Perpetually DAT Convert



Swift ELITE



Storage Online Gaming



Vacations MOV to DVD



Friday, June 18, 2010

Youtube Video to VOB Gold

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Supports customize or create user's own profile for any new (portable) device. The video conversion supports preview. About Playing Features. Embedded YouTube Video (Offline) Player is available, it supports offline play YouTube video, .flv video and .swf video. Supports "Drag and Drop" video files direct to the main window. Easy to select the source files. Cool UI skin available. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Digital MP3 APE M4P to VQF Converter



Bliss DVD-Audio MP2 To CD-R Conversion



X-Cloner DVD to MP4



Youtube Movie to iphone Top Rated



LasVegas MOV Converter



Merry CDA Audio Midi to M4P Copier



Transactionscope with nhibernate session



Recommend Kids Education



New Communications Tools



MuvAudio



video to iAudio 7 software



Flash to PSP Converter



Apex Free PMP Video Converter



Easy to use Compilers And Interpreters



RM Files Converter