PageSetupDialog1.PageSettings.Landscape = False/true

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Garima12
    New Member
    • Mar 2007
    • 58

    PageSetupDialog1.PageSettings.Landscape = False/true

    user is selecting from combobox either portrait or landscape for printing the page. I am writing following code to set it. it is not working. In preview it shows portrait in both cases.

    Code:
    If (ComboBox1.SelectedIndex = 0) Then
                PageSetupDialog1.PageSettings.Landscape = False
            Else
                PageSetupDialog1.PageSettings.Landscape = True
            End If
    can anyone please suggest?
    thks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Are you then USING the PageSettings object from there?

    Comment

    • Garima12
      New Member
      • Mar 2007
      • 58

      #3
      Originally posted by Plater
      Are you then USING the PageSettings object from there?
      sorry, i don't understand wht r u asking?
      i put pagesetupcontro l,printpreviewc ontrol and used the code written.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well let me ask this then, how do you know it's not working?
        If you don't use the PrintDocument (or at least assign those settings to aPrintDocument) from PageSetupDialog 1, you would never see the changes?

        Comment

        • Garima12
          New Member
          • Mar 2007
          • 58

          #5
          Originally posted by Plater
          Well let me ask this then, how do you know it's not working?
          If you don't use the PrintDocument (or at least assign those settings to aPrintDocument) from PageSetupDialog 1, you would never see the changes?
          I included PrintDocument1. should I set the property of PrintDocument1 in order to get page as landscape?
          suppose, there r pagesetupcontro l,printpreviewc ontrol,PrintDoc ument. can you please let me know, wht code should i write in order to set page as portrait or landscape as user selects from the combobox.
          thks

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Well if you are going to print something, you would have a PrintDocument. that PrintDocument is the one that needs to get the Landscape property set. Not the dialogbox you plan to popup?

            Comment

            Working...