[RESOLVED] commondialog printer help plz
Hi,
When I use the commondialog for selecting the printer to print to i.e.
VB Code:
Private Sub Command1_Click()
CommonDialog1.ShowPrinter
Me.PrintForm
End Sub
THere is a delay that depends on the size of the form. THe screen doesnt re-draw until it was made it to the printer.
Is there anyway to remove that delay so that as soon as you select "Print" in the commondialog it returns back to the program quickly?
Using the printer object is lighting quick!
Thanks
John
Re: commondialog printer help plz
Re: commondialog printer help plz
Roger that dglienna thanks! ;)
I use to have some code that was simular to this;
VB Code:
'Load up the Printers installed
Dim i As Integer ' For printer collection
For i = 0 To Printers.Count - 1 'Gets the printers installed on the sytem
cboPrinters.AddItem Replace(Printers(i).DeviceName & "[" & Printers(i).DriverName & "]", "[winspool]", "")
Next
But it had the default printer at the top of the list, BUT I have lost it :(
Anyone know how to do that?
Re: commondialog printer help plz
Just set the .TopIndex to the current printer. It won't matter if there are others above it. It will be the first one in the list that is seen.
Re: commondialog printer help plz
Quote:
Originally Posted by dglienna
Just set the .TopIndex to the current printer. It won't matter if there are others above it. It will be the first one in the list that is seen.
I cannot get rid of a blank entry on form load in the combo box. however the default printer is the the first on the list when you click on the down arrow.
Any idea why it loads a blank at top?
VB Code:
cboPrinters.Clear
'Load up the Printers installed
Dim i As Integer ' For printer collection
For i = 0 To Printers.Count - 1 'Gets the printers installed on the sytem
cboPrinters.AddItem Replace(Printers(i).DeviceName & "[" & Printers(i).DriverName & "]", "[winspool]", "")
Next
cboPrinters.List(0) = Printer.DeviceName
Re: commondialog printer help plz
That's the nature of a combobox. It combines a textbox and a listbox.
You probably want to use a Listbox instead.
Re: commondialog printer help plz
I finaly got it!
VB Code:
'Load up the Printers installed
Dim i As Integer ' For printer collection
For i = 0 To Printers.Count - 1 'Gets the printers installed on the sytem
cboPrinters.AddItem Replace(Printers(i).DeviceName & "[" & Printers(i).DriverName & "]", "[winspool]", "")
Next
cboPrinters.Text = Printer.DeviceName
Re: commondialog printer help plz
That way it is in there twice, but it works. A listbox doesn't have the extra line.
RESOLVED Re: commondialog printer help plz
I made the combobox style a listbox so it only appears once. You cannot type in the box with it like that so it works like a listbox.
On my original issue, I didnt have the form set to autodraw :(
Re: commondialog printer help plz
If this issue is resolved, then the first post needs the green checkmark the and resolved added to the title.
Neither will show up if placed on any post within the thread except the first. :)
A quick way to show a thread is resolved is to pull down the Thread Tools menu and click Mark Thread Resolved. :)
Re: [RESOLVED] commondialog printer help plz