Results 1 to 6 of 6

Thread: PictureBox on SSTab issues [Resolved}

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    PictureBox on SSTab issues [Resolved}

    Using VB5, SP2.
    Per Microsoft any SSTab issues corrected.


    Tried the following code and can't get the string to print on the
    picturebox.

    Any suggestions appreciated.

    Thanks
    David


    VB Code:
    1. Private Sub SSTab1_Click(PreviousTab As Integer)
    2.  
    3.    If SSTab1.Tab = 1 Then
    4.       With picTest
    5.          .ForeColor = vbBlack
    6.          .CurrentX = 10
    7.          .CurrentY = 10
    8.       End With
    9.       picTest.Print "AaBaCa"
    10.       picTest.Refresh                '<<added to see if needed a refresh
    11.    End If
    12.    
    13. End Sub
    Last edited by dw85745; Sep 8th, 2003 at 02:49 PM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Set the PictureBox.AutoRedraw property to True.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166
    Thanks for responding brucevde.

    ---------

    AutoRedraw = True.
    In all cases PBox appears is visible and correctly positioned on the tab.


    When text placed in PBox during Form_Load, text shows up OK in PBOx on tab.

    However, it doesn't on Tab_Click, NOR if I invoke a listbox choice and attempt to show choice of listbox in PBOX.

    Will try and make sample next hour or two and post.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166
    Here's the sample:

    Only issue still left open is tab fonts ALSO change when resetting pBox font.

    Other issues resolved when making sample. Used same code as large program so can only explain that system was shut down last night and something cleared from memory.
    Attached Files Attached Files

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    In several places you have code similar to the following
    VB Code:
    1. With picTab
    2.       .Cls
    3.       .ForeColor = vbBlack
    4.      
    5.       With Font
    6.          .Name = lstFonts.List(lstFonts.ListIndex)
    7.          .Italic = True
    8.       End With

    Note the With Font statement. Since you are not specifying which object's Font you want to modify it is using the Form's font object. Apparently, the SSTab is responing to these changes - which is unusual as most controls do not exhibit this behaviour.

    Anyways, I think you just want to change the Font of the picture box. So make sure you use

    With .Font

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166
    Thanks brucevde for catching my error.

    Guess old eyes are going.

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