Advertisement

05.12.2008 at 06:58AM PDT, ID: 23394538
[x]
Attachment Details

Add Text To PictureBox Icons?

Asked by LongFist in Microsoft Visual Basic.Net, VB Controls

Tags: Microsoft, Visual Studio 2005, 2K5, Display Icon Text?, PictureBox Icons Lack Description Text

Hi there!

I have a main menu that is constructed of panels denoting rows across a form, each row containing multiple icons referencing different functions available to the End-user.  It has been noted that, while these icons ac just like the icons on the desktop, they lack the text (anywhere) that describe what the icons do.

The beginning of this journey can be seen here: <http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_Studio_.NET_2005/Q_23362708.html>

Is there anything special that I can do to restore this text to the icons?  They move properly, act like desktop icons perfectly, just lack the description text.

I have tried (extremely unsuccessfully) to provide/create a control that combines the PictureBox control with the Label control, in the hopes of pulling these two attributes together.  I realize it's just a detail, but it's kind of important - as some status information is revealed at the icon text level - so I somehow need to add that capacity without removing the functionality of the icons (pictures) as they now exist.

I've tried the following code: (below)

I even tried using [ iconFX.Text = "Exit" ] - which compiles, but doesn't work/show on the form.

Thanks (in advance) for your time and expertise,

- The Lurking LongFistStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
Dim iconFX As PictureBox
      Dim nameText As Label
      Dim nuPanel As Panel
      Dim vDx As Integer = 0
 
 
 
      nuPanel = New Panel
      nuPanel.Location = New Point(0, CInt(Me.Height / CDbl(15)))
      nuPanel.Name = "nowPanel"
      nuPanel.Height = CInt(Me.Height / CDbl(6))
      nuPanel.Width = Me.Width
      nuPanel.BackColor = Color.LightGreen
      nuPanel.BackgroundImage = New Bitmap(Me.GetType, "ProcSpirals.png")
      nuPanel.BackgroundImageLayout = ImageLayout.Tile
      nuPanel.BorderStyle = BorderStyle.None
      nuPanel.Anchor = AnchorStyles.Left Or AnchorStyles.Right Or AnchorStyles.Top
 
      nameText = New Label
      nameText.Name = "mainID"
      nameText.BackColor = Color.Transparent
      nameText.Anchor = AnchorStyles.Right Or AnchorStyles.Bottom
      nameText.AutoSize = True
      nameText.BorderStyle = BorderStyle.None
      nameText.Text = "Main"
      nameText.Location = New Point(((nuPanel.Width - nameText.PreferredSize.Width) - 13), (nuPanel.Height - nameText.PreferredSize.Height))
      nuPanel.Controls.Add(nameText)
 
      iconFX = New PictureBox
      iconFX.BackgroundImage = New Bitmap(Me.GetType, "EDM_Generic.ico")
      iconFX.BackgroundImageLayout = ImageLayout.Stretch
      iconFX.Size = New Size(60, 60)
      iconFX.Name = "ExitIcon"
      iconFX.Text = "Exit"
      iconFX.Location = New Point(10, 10)
      iconFX.BorderStyle = BorderStyle.FixedSingle
      AddHandler iconFX.MouseDown, AddressOf specMouseDown
      AddHandler iconFX.MouseMove, AddressOf specMouseMove
      AddHandler iconFX.DoubleClick, AddressOf icon_Exit_DoubleClick
      nuPanel.Controls.Add(iconFX)
 
      vDx = (nuPanel.Location.Y + nuPanel.Height)
      Me.Controls.Add(nuPanel)
[+][-]05.12.2008 at 07:31AM PDT, ID: 21547301

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 08:47AM PDT, ID: 21548009

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 11:27AM PDT, ID: 21549365

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, VB Controls
Tags: Microsoft, Visual Studio 2005, 2K5, Display Icon Text?, PictureBox Icons Lack Description Text
Sign Up Now!
Solution Provided By: Idle_Mind
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628