请教屏幕背景渐变以及数据库的问题
我有两个问题向诸位VB高手请教:
1。我利用重画屏幕线条的方法实现了屏幕背景渐变,但是现在存在一个问题,
我能很明显地看到屏幕刷新的过程,这是不希望外界用户看到的,因此不
知道是否有解决的方法(有没有类似先写入内存再form1.show),源代码
如下:
Function getred(colorval As Long) As Integer
getred = colorval Mod 256
End Function
Function getgreen(colorval As Long) As Integer
getgreen = ((colorval And &HFF00FF00) / 256&)
End Function
Function getblue(colorval As Long) As Integer
getblue = ((colorval And &HFF0000) / (256& * 256&))
End Function
Private Sub Form_Resize()
Dim ipixel, pwidth As Integer
Dim redinc, greeninc, blueinc As Single
Dim color1 As Long, color2 As Long
color1 = RGB(64, 64, 64)
color2 = RGB(0, 0, 255)
startred = getred(color1)
endred = getred(color2)
startgreen = getgreen(color1)
endgreen = getgreen(color2)
startblue = getblue(color1)
endblue = getblue(color2)
pwidth = Form1.ScaleWidth
redinc = (endred - startred) / pwidth
greeninc = (endgreen - startgreen) / pwidth
blueinc = (endblue - startblue) / pwidth
For ipixel = 0 To pwidth - 1
newcolor = RGB(startred + redinc * ipixel, startgreen + greeninc
* ipixel, startblue + blueinc * ipixel)
Form1.Line (ipixel * 2, 0)-(ipixel * 2, Form1.Height - 1),
newcolor
Next
2。我使用data和data grid控件来显示foxpro的数据库table1.dbf,现在我需要显示
table1的子集,即利用条件限制部分记录,我应该怎样做?我试过
data1.recordsource="select * from table1 where field1>0"
data1.recordsource="field1>0"
都不行,错误为"找不到对象"
请高手指点,谢谢!!