Changing & Indicating Default Printer Tool Strip Menu Item Control
I'm using the below to generate the list of installed printers and add them to a Tool Menu Strip
Code:
Private Sub PrinterToolStripMenuItem_DropDownOpening(sender As Object, e As EventArgs) Handles PrinterToolStripMenuItem.DropDownOpening
PrinterToolStripMenuItem.DropDownItems.Clear()
Dim printers As New Printing.PrintDocument()
Dim printername = printers.PrinterSettings.PrinterName
For Each printername In PrinterSettings.InstalledPrinters
PrinterToolStripMenuItem.DropDownItems.Add(printername)
Next
End Sub
I have the following code to determine the default printer and would like to assign an image to the respective name in the list but i'm not sure on how to do this
Code:
Dim settings As New PrinterSettings()
'' This is where i would assign the image to settings.PrinterName
I would then like to be able to change the default printer via a Double Click of which i have the code below but again i am not sure on how to accomplish this
Code:
Dim PrinterName As String = ''Selected item form Menu Tool Item
Shell(String.Format("rundll32 printui.dll,PrintUIEntry /y /n ""{0}""", PrinterName))
I've managed to work this using a button and listbox but I'm struggling with the tool menu item.
Can anyone point me in the right direction of where to look please?
Cross posted here http://stackoverflow.com/questions/2...u-item-control
Thanks
Re: Changing & Indicating Default Printer Tool Strip Menu Item Control
Check out the toolstripmenuitem's Image and DisplayStyle properties. That should give you some ideas as to how to handle assigning an image for the default printer.