473,395 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ImageCombos- how to use them?

D T
Hi,
I need some general info on ImageCombos
how do you use them? how do u put imgs into them?
can u use them as normal combos? can u do an event according to what img
the user chose?

Thanx
|DT|

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 1100
Hi,

Here is an example.

Dim arColor() As String

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DrawMode = DrawMode.OwnerDrawFixed
ComboBox1.Location = New Point(60, 60)
ComboBox1.Width = 150
ComboBox1.Visible = True
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

arColor = KnownColor.GetNames(GetType(KnownColor))
ComboBox1.Items.AddRange(arColor)
End Sub
Private Sub combobox1_DrawItem(ByVal sender As Object, ByVal e As
System.Windows.Forms.DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim g As Graphics = e.Graphics
Dim s As String
Dim d As Date
Dim br As Brush = SystemBrushes.WindowText
Dim brBack As Brush
Dim rDraw As Rectangle
Dim bSelected As Boolean = CBool(e.State And DrawItemState.Selected)
Dim bValue As Boolean = CBool(e.State And
DrawItemState.ComboBoxEdit)

rDraw = e.Bounds
rDraw.Inflate(-1, -1)

If bSelected And Not bValue Then
brBack = Brushes.LightBlue
g.FillRectangle(Brushes.LightBlue, rDraw)
g.DrawRectangle(Pens.Blue, rDraw)
Else
brBack = Brushes.White
g.FillRectangle(brBack, e.Bounds)
End If

br = Nothing
brBack = Nothing
rDraw = Nothing

Try
s = ComboBox1.Items.Item(e.Index).ToString
Catch
s = ""
End Try

Dim x, y As Integer

x = e.Bounds.Left + 25
y = e.Bounds.Top + 1
Dim c As Color
Dim b As SolidBrush
c = Color.FromName(s)
b = New SolidBrush(c)

g.FillRectangle(b, x - 20, y + 2, 10, 10)
g.DrawString(s, ComboBox1.Font, Brushes.Black, x, y)
End Sub
Ken
------------------
"D T" <dt*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
I need some general info on ImageCombos
how do you use them? how do u put imgs into them?
can u use them as normal combos? can u do an event according to what img
the user chose?

Thanx
|DT|

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
"D T" <dt*******@hotmail.com> schrieb
Hi,
I need some general info on ImageCombos
how do you use them? how do u put imgs into them?
can u use them as normal combos? can u do an event according to what
img the user chose?


There is no ImageCombo in VB.Net or the .Net Framework.

http://msdn.microsoft.com/library/en...bleObjects.asp
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* D T <dt*******@hotmail.com> scripsit:
I need some general info on ImageCombos
how do you use them? how do u put imgs into them?
can u use them as normal combos? can u do an event according to what img
the user chose?


You will have to create an ownerdrawn combobox. Samples can be found
here:

<URL:http://www.codeproject.com/cs/combobox/>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
D T
Hi Ken,
Thanks for your reply but is not what im looking for, Sorry perhaps I
didnt explain it well enough, you see there is an component you can load
that comes with Microsoft VB 6.0 called Microsoft Windows Common
Controls 6.0 (sp6) (MsComClt.ocx). There U can find a control called
ImageCombo. I want to know how to use them.

Thanks :-)
|DT|

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Jakob Bieling | last post by:
Hi, somehow the prejudice of exceptions being rather slow (compared to, ie. returning an error value and checking that) keeps sticking around .. at least around me. I guess this is also why I...
13
by: Nemok | last post by:
Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save...
3
by: John Baker | last post by:
Hi: I just ran an Access application on someone elses system (With Access 2002). I made some changes (on his system) and then copied the program (data and program are still on the same file)...
6
by: Marcia Hon | last post by:
Hi, I am writing a P2P client application. As such, I am creating packets that are to be sent between the peers. I would like to know how in C these bits of the packets may be programmed. These...
5
by: Yoramo | last post by:
Hello is it possible to display images on a ASPX without having them on the disk of the server ? I have images in a DB and whould like to display them on a web page. writing them to disk...
19
by: Alan Silver | last post by:
Hello, Having discovered what I believe to be two CSS bugs in IE7, I have submitted bug reports to MS. AFAIK, these don't get acted on until they receive votes form others to say they are worth...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
4
by: Steve | last post by:
I have read a couple articles online, read my Jesse Liberty book but I am still confused as to just what the best practices are for using exceptions. I keep changing how I'm working with them and...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.