Results 1 to 2 of 2

Thread: Changing & Indicating Default Printer Tool Strip Menu Item Control

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2013
    Posts
    40

    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
    Last edited by MarkGB; May 12th, 2014 at 12:56 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width