Startpage by using an combobox

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Startpage by using an combobox
Dummy1912
Hello,

How can i use my combobox to view the printpages i want to see
on my preview document
Code: Select all
If Not ComboBox2.Items.Contains(String.Format("{0}", Me.PrintPreviewControl1.PageCount)) Then
            ComboBox2.Items.Add(String.Format("{0}", Me.PrintPreviewControl1.PageCount))
        End If
        
        'we have 2 pages
        
        Private SubiComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
        Dim sheets As Double = ComboBox2.SelectedText.ToString
        Me.PrintPreviewControl1.StartPage += sheets
    End Sub
If we select 1 we get the first page thats cool
but when we select 2 we don't get the next page
we like to use our combobox as a sort of next page and previous page option instead of buttons

Thank you.
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Not sure about this one. Try using just "=" instead of "+="
Code: Select all
'we have 2 pages Private SubiComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged Dim sheets As Double = ComboBox2.SelectedText.ToString Me.PrintPreviewControl1.StartPage = sheets End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

:errm;
didn't think of that.. taking hours to look at the complete code for this..
and it was just my mistake ahahhaahaha

Thanks friend ;)
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
3 posts Page 1 of 1
Return to “Coding Help & Support”