|
-
Jun 19th, 2002, 03:21 PM
#1
Thread Starter
Fanatic Member
Help VB Won't listen to me!!!!!
Ok, this makes NO sense to me here. This was working fine until I added code to my form load event to use BitBlt to paint the form background. I have a command button called cmdtoggle. Here is the code I have on it.
VB Code:
Private Sub cmdtoggle_Click()
If cmdtoggle.Caption = "Show Playlist" Then
ListView1.Height = 4215
cmdtoggle.Caption = "Hide Playlist"
Else
ListView1.Height = 6855
cmdtoggle.Caption = "Show Playlist"
End If
End Sub
The button caption says "Show Playlist" by default on startup. Somehow it gets confused and changes between the Show & hide button captions just fine, but it goes haywire on setting the height of listview1. When you click the button, it makes the listview height somthing that goes off the bottom of the screen. Any ideas? Thanks in advance.
-
Jun 19th, 2002, 04:16 PM
#2
Thread Starter
Fanatic Member
I removed this & it works fine......
VB Code:
Private Sub Form_Load()
ScaleMode = 3
Picture1.AutoRedraw = True
Me.AutoRedraw = True
For x = 0 To Width Step Picture1.Width
For y = 0 To Height Step Picture1.Height
DoEvents
BitBlt hDC, x, y, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hDC, 0, 0, vbSrcCopy
Next y
Next x
End Sub
Why does the BitBlt code that paints the form mess up the code on a command button??
-
Jun 19th, 2002, 08:37 PM
#3
PowerPoster
Your problem is actually this one line:
Which is setting the ScaleMode to pixels. Hence, 4000px high will go off the bottom of the screen. A standard screen res may be as little as 800x600 pixels. 4000 is obviously way beyond that... 
Either set the ScaleMode to 1 (twips) or adjust your sizing values to match pixels.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|