How can you add an image to a listbox in VB? - vb.net

I am wanting to add an image to the top or background of a listbox. I would like it to be visible on the screen, but more importantly is that it prints. Can someone help me with the code for this. I tried to see if you could add it through properties and don't see that option. I need the listbox not listview. Also I was wondering if it could be added as a string and the file referenced at the top of the listbox (when you right click the little arrow and click edit options? Can someone please help. I am working on a project and still very new at this.

You need to create a custom ListBox class and add the ability to draw a custom background by overriding the OnPaint event, like on:
Source: http://www.vbforums.com/showthread.php?416784-2005-ListBox-Background-Image

Related

VB.Net: Winforms Designer: Use verbs from custom control in parent custom control

We're developing a custom control (to make our lives easier), which included a customs (external) grid control and some default buttons and text. The grid control has the option to add columns by clicking the small arrow on the top right of the grid in designer, like shown in the picture.
We want to keep this option when putting our new custom control on a (win)form. Is there any way we can achieve this?
I've already looked into the 'verbs' and I can add my own custom verbs to the new control, but I'm not sure the arrow is a verb (as it does not show the option on the bottom of the properties). I also haven't been able to find how to use the verbs from the grid control.
Thank you very much!
I've found the solution to my problem.
I thought the way to add columns was a custom control when in reality, it was a default CollectionEditor. This, in combination with Smart Tag, solved my problem.

Can Not Delete Control in VS2010

At the top of the Properties Window in VS2010, I can see a list of all of the controls on my form. In that last, I see "PictureBox1," even though I don't see a corresponding PictureBox in the Form window.
I can change the location and size of the PictureBox, and set its image to a picture that should be noticeable. I still see nothing on the GUI form. If I can't find something to click on the GUI form, however, I don't know how to get rid of this superfluous PictureBox.
Is there some backdoor method that I can use to get rid of this PictureBox? It seems if the Properties Window lists it, it should offer some method to delete it.
A simple explanation is that it is covered by something else. Use View + (Other Windows) + Document Outline to see it. You can drag+drop it back on top. Or just right-click + Delete and its gone.

can i make a window form(common controls) using code in vb.net?

instead of dragging and dropping a common control in vb.net, is there a way to hard code it?
or is there a way for me to be able to view the codes where a dragged and dropped object has
been created? thank you so much!
The auto-generated code is intentionally hidden in the VB.NET IDE. But you can easily reveal it. Click the "Show All Files" toolbar button in the Solution Explorer window. You'll now see the Form nodes in your project displayed with a triangle. Click on it to reveal the Designer.vb file. And double-click that to see the code.
Observe the changes in the InitializeComponent() method as you use the designer to add/remove/edit controls. It isn't perfect code, the machine generated it, but it gives you a major leg-up on what kind of code you need to write to "hard-code".

Embed CommandBar into Form

I'm not sure if this is at all possible, but I'd like to be able to 'embed' a CommandBar into an Access 2003 Form.
I'd like to do this because the nature of my application is such that its forms are 'floating' so it doesn't look like it was developed in Access.
I know I can put Command Buttons on the form, which would achieve something similar, but I'd like a way to differentiate between the two types of buttons.
I'll be using it (if it's possible) to have a help menu present on some Forms.
Any ideas would be greatly appriciated!
I managed to achieve a similar effect by placing labels of a different color at the top of the form, then assign custom context menus to appear on left click. This is similar to the code found here:
How to add a menu item to the default right click context menu

How to edit Expression Blend selected control part?

I am trying to edit a specific control part within a custom TabItem Template. In this case, it's the TemplateBottomSelected control part.
I'm having an issue where I cannot seem to view or edit any control parts within the template editor except the default TemplateTopSelected. Here's a screenshot of what I'm talking about:
Even though I'm selecting the "TemplateBottomSelected" grid, the only thing I can see is the template for the TemplateTopSelected item.
How the heck do I edit the other control parts within the template using the editor?
Thanks!
that's because these templates are either collapsed or the opacity of them is set to 0. :)
you can use the eye toggle button to only show the one you want to modify at design time, set the visibility to visible, do your changes, and reset it to collapsed.
please let me know if you need more info.