Cannot get the OpenFileDialog and ColorDialog controls in the component tray
-
Sunday, April 01, 2012 6:31 PMI hane followed all step as described in chapter 4 pages 108 through 112. I can not get the OpenFileDialog or the ColorDialog into the component tray. I am using VB2008 Express. I have redone my work mant times and connot get this solved. What can I do to solve this. I have seen where others have asked this same question. Please help
All Replies
-
Sunday, April 01, 2012 7:21 PM
Hi Gary
I haven't had that happen to me.
if you add one from the toolbox,does it show in the list in the Properties pane at all?
But unless you really need it in the component tray, why not just create one in code?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cbd As New ColorDialog If cbd.ShowDialog = Windows.Forms.DialogResult.OK Then Button1.BackColor = cbd.Color End If End Sub
“This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.”
- Edited by jwavilaMVP Monday, April 02, 2012 4:35 AM
- Proposed As Answer by Mark Liu-lxfModerator Tuesday, April 03, 2012 4:28 AM
- Marked As Answer by Mark Liu-lxfModerator Tuesday, April 10, 2012 5:44 AM
-
Monday, April 02, 2012 5:16 PM
It still did not work. I deleted the project and than rebuilt it still cannot get then to the tray
When I did try to copy and paste the code it didnot show in the tray and when I reviewed the code I receive an error that Button1 was not declared. Thanks
-
Monday, April 02, 2012 6:10 PM
it won't show in the tray if you do it in code.
so, create a new WinForms app and add a button from the toolbox to the form. Then add the code above and run it
“This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.”

