Click here to Skip to main content
15,914,323 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: which dll should i import/reference?? Pin
Guffa25-Oct-06 3:52
Guffa25-Oct-06 3:52 
GeneralRe: which dll should i import/reference?? Pin
K edar V25-Oct-06 18:38
K edar V25-Oct-06 18:38 
GeneralRe: which dll should i import/reference?? Pin
Guffa26-Oct-06 9:16
Guffa26-Oct-06 9:16 
Questionmoving from one listbox to another Pin
samerh25-Oct-06 1:56
samerh25-Oct-06 1:56 
QuestionRe: moving from one listbox to another Pin
Are Jay25-Oct-06 6:55
Are Jay25-Oct-06 6:55 
AnswerRe: moving from one listbox to another Pin
samerh25-Oct-06 18:49
samerh25-Oct-06 18:49 
QuestionDesigning Controls Pin
ChPortos24-Oct-06 23:41
ChPortos24-Oct-06 23:41 
AnswerRe: Designing Controls Pin
Dave Kreskowiak25-Oct-06 5:26
mveDave Kreskowiak25-Oct-06 5:26 
You should have asked this in the Mobile Development[^] forum. The .NET Compact framework doesn't support everything it's desktop cousin does.

I don't do mobile dev so I have no idea if this is supported. But, in the desktop world, you set up your ConstrolStyles, turning on DoubleBuffering and handling all the painting yourself:
Public Class MyControl
    Public Sub New
        SetStyle(ControlStyles.AllPaintingInWmPaint, True)
        SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
        SetStyle(ControlStyles.UserPaint, True)
    End Sub

Then you override OnPaint where you do all of your painting. This should eliminate the flicker.

Another method would be to just paint your entire control to an offsreen Bitmap, then just copy the bitmap to the drawing surface in your OnPaint:
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    Dim backBuffer As New Bitmap(Me.ClientRectangle.Width, Me.ClientRectangle.Height)
    Dim bg As Graphics = Graphics.FromImage(backBuffer)
    ' Do all your control painting here
    bg.draw...this and that
    bg.Dispose()
 
    ' Now draw your buffered image to your control surface
    Dim g As Graphics = e.Graphics
    g.DrawImage(backBuffer, 0, 0, backBuffer.Width, backBuffer.Height)
End Sub



Dave Kreskowiak
Microsoft MVP - Visual Basic


QuestionStored Procs Pin
Pete Newman24-Oct-06 22:47
Pete Newman24-Oct-06 22:47 
AnswerRe: Stored Procs Pin
Are Jay25-Oct-06 7:54
Are Jay25-Oct-06 7:54 
GeneralRe: Stored Procs Pin
Pete Newman25-Oct-06 22:07
Pete Newman25-Oct-06 22:07 
GeneralRe: Stored Procs Pin
Pete Newman26-Oct-06 4:13
Pete Newman26-Oct-06 4:13 
GeneralRe: Stored Procs Pin
Are Jay27-Oct-06 3:48
Are Jay27-Oct-06 3:48 
GeneralRe: Stored Procs Pin
Pete Newman27-Oct-06 3:51
Pete Newman27-Oct-06 3:51 
Question"Is Nothing" not running Pin
amapumu24-Oct-06 22:25
amapumu24-Oct-06 22:25 
AnswerRe: "Is Nothing" not running Pin
Dave Kreskowiak25-Oct-06 5:16
mveDave Kreskowiak25-Oct-06 5:16 
GeneralRe: "Is Nothing" not running Pin
amapumu26-Oct-06 3:05
amapumu26-Oct-06 3:05 
GeneralRe: "Is Nothing" not running Pin
Dave Kreskowiak26-Oct-06 5:43
mveDave Kreskowiak26-Oct-06 5:43 
QuestionSaving an Image in VB.NET Pin
Zaegra24-Oct-06 21:09
Zaegra24-Oct-06 21:09 
AnswerRe: Saving an Image in VB.NET Pin
Dave Kreskowiak25-Oct-06 5:12
mveDave Kreskowiak25-Oct-06 5:12 
GeneralRe: Saving an Image in VB.NET Pin
Zaegra27-Oct-06 1:19
Zaegra27-Oct-06 1:19 
QuestionHow to insert records from DataGridView to SQL Server database Pin
VS200524-Oct-06 20:59
VS200524-Oct-06 20:59 
AnswerRe: How to insert records from DataGridView to SQL Server database Pin
Dave Kreskowiak25-Oct-06 4:48
mveDave Kreskowiak25-Oct-06 4:48 
QuestionRe: How to insert records from DataGridView Of Visual Studio 2005 to SQL Server database Pin
VS200525-Oct-06 15:59
VS200525-Oct-06 15:59 
QuestionBest book for 'Working with graphics in VB.Net' or GDI+? Pin
BetimD24-Oct-06 20:44
BetimD24-Oct-06 20:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.