Image in toolbar disappeared

  • Thread starter Thread starter Hugh
  • Start date Start date
H

Hugh

after I changed the image size. I tried different
combinations of images sizes and button sizes. I have
tried both botton and the image in the same sizes or
button size was larger than that of image. The images
were still invisible. What is the trick? I asked this
question a while ago. Thanks.
 
* "Hugh said:
after I changed the image size. I tried different
combinations of images sizes and button sizes. I have

I don't think that this is caused by a wrong button size.

Can you post the complete code of the form where the images don't
appear?
 
Hi Herfried,

There is no code. The settings are in property window. The
code itself is very large. let me try to see if Ican
reproduce the problem in a simple code and post the code
late. Thanks for offer.

Hugh
 
* "Hugh said:
There is no code. The settings are in property window. The
code itself is very large. let me try to see if Ican
reproduce the problem in a simple code and post the code
late. Thanks for offer.

OK.
 
Hi Herfried,

I deleted all code and objects on the designer except for
toolbar in my application, the images in the toolbar were
still invisible in debugging mode. This drives me crazy.
Following is the code generated my window. Thanks very
much.

Hugh

Public Class MainForm
Inherits System.Windows.Forms.Form


#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()
'This call is required by the Windows Form
Designer.
InitializeComponent()
'Add any initialization after the
InitializeComponent() call
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal
disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the
Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ToolBar1 As
System.Windows.Forms.ToolBar
Friend WithEvents tbNew As
System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarImageList As
System.Windows.Forms.ImageList
Friend WithEvents tbRemove As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbFillGrid As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbPrint As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbExit As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbGemini As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbOpenFile As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbBlack As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbDelete As
System.Windows.Forms.ToolBarButton
Friend WithEvents ofdFileSets As
System.Windows.Forms.OpenFileDialog
Friend WithEvents tbMethodFile As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbHelp As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbDeckLayout As
System.Windows.Forms.ToolBarButton
Friend WithEvents tbAbout As
System.Windows.Forms.ToolBarButton
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager
= New System.Resources.ResourceManager(GetType(MainForm))
Me.ToolBar1 = New System.Windows.Forms.ToolBar
Me.tbNew = New System.Windows.Forms.ToolBarButton
Me.tbOpenFile = New
System.Windows.Forms.ToolBarButton
Me.tbRemove = New
System.Windows.Forms.ToolBarButton
Me.tbFillGrid = New
System.Windows.Forms.ToolBarButton
Me.tbMethodFile = New
System.Windows.Forms.ToolBarButton
Me.tbGemini = New
System.Windows.Forms.ToolBarButton
Me.tbPrint = New System.Windows.Forms.ToolBarButton
Me.tbDeckLayout = New
System.Windows.Forms.ToolBarButton
Me.tbBlack = New System.Windows.Forms.ToolBarButton
Me.tbDelete = New
System.Windows.Forms.ToolBarButton
Me.tbExit = New System.Windows.Forms.ToolBarButton
Me.tbAbout = New System.Windows.Forms.ToolBarButton
Me.tbHelp = New System.Windows.Forms.ToolBarButton
Me.ToolBarImageList = New
System.Windows.Forms.ImageList(Me.components)
Me.ofdFileSets = New
System.Windows.Forms.OpenFileDialog
Me.SuspendLayout()
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New
System.Windows.Forms.ToolBarButton() {Me.tbNew,
Me.tbOpenFile, Me.tbRemove, Me.tbFillGrid,
Me.tbMethodFile, Me.tbGemini, Me.tbPrint, Me.tbDeckLayout,
Me.tbBlack, Me.tbDelete, Me.tbExit, Me.tbAbout, Me.tbHelp})
Me.ToolBar1.ButtonSize = New System.Drawing.Size
(20, 19)
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.Font = New System.Drawing.Font
("Microsoft Sans Serif", 7.8!,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ToolBar1.ImageList = Me.ToolBarImageList
Me.ToolBar1.Location = New System.Drawing.Point(0,
0)
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(376, 31)
Me.ToolBar1.TabIndex = 0
'
'tbNew
'
Me.tbNew.ImageIndex = 0
Me.tbNew.Tag = "New"
Me.tbNew.ToolTipText = "New"
'
'tbOpenFile
'
Me.tbOpenFile.ImageIndex = 1
Me.tbOpenFile.Tag = "Open File"
Me.tbOpenFile.ToolTipText = "Open File"
'
'tbRemove
'
Me.tbRemove.ImageIndex = 2
Me.tbRemove.Tag = "Remove file"
Me.tbRemove.ToolTipText = "Remove entries"
'
'tbFillGrid
'
Me.tbFillGrid.ImageIndex = 3
Me.tbFillGrid.Tag = "Fill Grid"
Me.tbFillGrid.ToolTipText = "Fill Grid"
'
'tbMethodFile
'
Me.tbMethodFile.ImageIndex = 5
Me.tbMethodFile.Tag = "Gemini File"
Me.tbMethodFile.ToolTipText = "Save Gemini File"
'
'tbGemini
'
Me.tbGemini.ImageIndex = 6
Me.tbGemini.Tag = "Gemini"
Me.tbGemini.ToolTipText = "Run Gemini"
'
'tbPrint
'
Me.tbPrint.ImageIndex = 7
Me.tbPrint.Tag = "Print"
Me.tbPrint.ToolTipText = "Print"
'
'tbDeckLayout
'
Me.tbDeckLayout.ImageIndex = 10
Me.tbDeckLayout.Tag = "Deck Layout"
Me.tbDeckLayout.Text = "Deck Layout"
Me.tbDeckLayout.ToolTipText = "Deck Layout"
'
'tbBlack
'
Me.tbBlack.Enabled = False
'
'tbDelete
'
Me.tbDelete.Enabled = False
Me.tbDelete.ImageIndex = 12
Me.tbDelete.Tag = "Delete"
Me.tbDelete.ToolTipText = "Delete source files"
'
'tbExit
'
Me.tbExit.ImageIndex = 11
Me.tbExit.Tag = "Exit"
Me.tbExit.ToolTipText = "Exit"
'
'tbAbout
'
Me.tbAbout.ImageIndex = 9
Me.tbAbout.Tag = "About"
Me.tbAbout.Text = "Software"
Me.tbAbout.ToolTipText = "About Software"
'
'tbHelp
'
Me.tbHelp.ImageIndex = 8
Me.tbHelp.Tag = "Help"
Me.tbHelp.Text = "Help"
Me.tbHelp.ToolTipText = "Help"
'
'ToolBarImageList
'
Me.ToolBarImageList.ImageSize = New
System.Drawing.Size(20, 19)
Me.ToolBarImageList.ImageStream = CType
(resources.GetObject("ToolBarImageList.ImageStream"),
System.Windows.Forms.ImageListStreamer)
Me.ToolBarImageList.TransparentColor =
System.Drawing.Color.Transparent
'
'MainForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(376, 125)
Me.Controls.Add(Me.ToolBar1)
Me.Font = New System.Drawing.Font("Microsoft Sans
Serif", 8.25!, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"),
System.Drawing.Icon)
Me.Name = "MainForm"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Test"
Me.ResumeLayout(False)

End Sub

#End Region

End Class
 
* said:
I deleted all code and objects on the designer except for
toolbar in my application, the images in the toolbar were
still invisible in debugging mode. This drives me crazy.
Following is the code generated my window. Thanks very
much.

Mhm... The code looks OK for me. Do you use an application manifest
with "devenv.exe"?
 
Hi Herfried,

I created two more toolbars on the designer and user the
same imagelist for these two toolbars. I can change sizes
of the images and buttons of these two new toolbars and
the images were still visible. However, the images in
origial toolbar were still invisible even I set sizes of
images and buttons of original toolbar the same as those
new toolbars. I think the original toolbar is corrupted
somehow. This is really strange. What do you think?

Hugh
 
Hi Ken,
Thanks for the link. I was crazy and called microsoft to
see if it is a reported bug. I received no answer yet.

Hugh
 
Your Welcome

Ken
------------
Hi Ken,
Thanks for the link. I was crazy and called microsoft to
see if it is a reported bug. I received no answer yet.

Hugh
 
Back
Top