Country and State ComboBox VB.NET

Completed Posted Jan 4, 2009 Paid on delivery
Completed Paid on delivery

I need a customer combobox in VB.NET (or it can be C# just so long as I can use it in my VB.NET Project). The combo box needs to display countries with their flag next to the country, I will provide these icons in a zip on work acceptance. Under countries there needs to optionally be sub-locations (no icons needed) which I provide to the control.

Example:

[icon] Random Location

[flag] United States

California, San Diego

New York, New York

[flag] Japan

[flag] England

London

While it does not show above in HTML, the sub-locations need to be indented under the countries.

## Deliverables

As in the above example some countries may have sub-locations, sub may not. The country itself should always be selectable as well. At the top of the ComboBox should always be "Random Location" with a custom icon.

The control needs to populate itself via ISO 2-letter country codes. So in the above example I would of said something like [url removed, login to view]('us')

Sublocations are just stringes passed to the control, but we should be able to give them a value that is returned by the control.

In short I need to be able to know what item is selected by [url removed, login to view] and have it return:

xx = Country code, when a country is selected e.g. us, gb, ...

** = Random Location is selected.

[url removed, login to view] = Example of a sublocation selection "ca1" is something that was passed to the control for the location "California, San Diego." The us. is the country this location is under (United States).

Here is C# code that displays icons in a custom ComboBox:

[url removed, login to view]

Here is ISO 2 letter codes:

[url removed, login to view]

Use enumeration to translate two digit codes into names so that the control can easily be modified for geographic changes.

Flags will be provided on work acceptance, they are in the GIF format. These icons should be provided by the project which hosts the control, i.e. your example project. They should be in the projects image resources. Here is example code in VB.NET for using a parents resources:

Public Class cResources

Private m_images As [url removed, login to view]

Public Sub New()

m_images = New [url removed, login to view]([url removed, login to view]().GetName().Name + ".Resources", [url removed, login to view]())

End Sub

Public ReadOnly Property Images() As [url removed, login to view]

Get

Return m_images

End Get

End Property

Public Function GetImage(ByVal imageId As Integer) As Image

Return [url removed, login to view]([url removed, login to view]([url removed, login to view]), [url removed, login to view])

End Function

Public Function GetImage(ByVal imageId As String) As Image

Return [url removed, login to view](imageId, [url removed, login to view])

End Function

Public Function GetIcon(ByVal imageId As Integer) As Icon

Return [url removed, login to view]([url removed, login to view]([url removed, login to view]), [url removed, login to view])

End Function

Public Function GetIcon(ByVal imageId As String) As Icon

Return [url removed, login to view](imageId, [url removed, login to view])

End Function

Public Function GetString(ByVal stringID As String) As String

Return [url removed, login to view]([url removed, login to view](stringID, [url removed, login to view]), [url removed, login to view])

End Function

End Class

Therefore the control project would only need to do: [url removed, login to view]("flag_" & countryCodeHere)

to get the img to display next to the country.

All ISO codes need to work, but only when added to the control. An example project should deminstrate use of this code including adding all possible countires, some with sublocations.

.NET C# Programming Engineering Microsoft MySQL PHP Project Management Software Architecture Software Testing Visual Basic Windows Desktop

Project ID: #3515677

About the project

3 proposals Remote project Active Jan 4, 2009

Awarded to:

FreeDevelopers

See private message.

$85 USD in 8 days
(50 Reviews)
6.5

3 freelancers are bidding on average $57 for this job

sathyanus

See private message.

$68 USD in 8 days
(80 Reviews)
5.1
romyandre

See private message.

$17 USD in 8 days
(1 Review)
0.0