Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: speeding up web application response Pin
Christian Graus1-Nov-07 16:20
protectorChristian Graus1-Nov-07 16:20 
GeneralRe: speeding up web application response Pin
uglyeyes1-Nov-07 17:03
uglyeyes1-Nov-07 17:03 
GeneralRe: speeding up web application response Pin
Christian Graus1-Nov-07 17:43
protectorChristian Graus1-Nov-07 17:43 
QuestionAdding and Subtracting Dates Pin
GeorgieMPorgie1-Nov-07 13:35
GeorgieMPorgie1-Nov-07 13:35 
AnswerRe: Adding and Subtracting Dates Pin
Luc Pattyn1-Nov-07 13:40
sitebuilderLuc Pattyn1-Nov-07 13:40 
AnswerRe: Adding and Subtracting Dates Pin
Guffa1-Nov-07 13:57
Guffa1-Nov-07 13:57 
GeneralRe: Adding and Subtracting Dates Pin
GeorgieMPorgie6-Nov-07 12:41
GeorgieMPorgie6-Nov-07 12:41 
Questionextended picturebox Pin
2hdass1-Nov-07 13:11
2hdass1-Nov-07 13:11 
Hi, i have been trying to create my own version of the picture box, i did this by first creating a user control and then using the keyword inherits System.Windows.Forms.PictureBox

What i really want to do is that i wanna be able to create a button that is 50% transparent when mouse is no over it, and it will become opaque when the mouse hovers over it. I made it a picturebox because it will load a gif image from the resx file.

I have overrided the OnPaint function so that it will display the image in the control, the layout is as following.

I put this control on top of another PictureBox, and when I run it, it gives me a while box instead of displaying the image. I debugged it and find that the displaying of the image is fine until this onPaint is over, (i.e. when the pointer steps out of this method, and that the PictureBox underneath is displayed, this control will turn into a white box)

How can i fix this?!Confused | :confused: Confused | :confused:

Thx

Code:
<br />
        Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)<br />
            MyBase.OnPaint(pe)<br />
            Dim g As Graphics = Me.CreateGraphics()<br />
            g.Clear(Me.BackColor)<br />
<br />
            '-------------------call image from resources ---------<br />
            Dim myAssembly As System.Reflection.Assembly<br />
            myAssembly = Me.GetType.Assembly<br />
<br />
<br />
            ' Creates the ResourceManager.<br />
            Dim myManager As New _<br />
               System.Resources.ResourceManager("PictureResizer.Images", _<br />
               myAssembly)<br />
<br />
            Dim myImage As System.Drawing.Image<br />
            myImage = CType(myManager.GetObject("flipccw"), _<br />
                System.Drawing.Image)<br />
            '----------------------------------------------<br />
            Dim bitmap As Bitmap = New Bitmap(myImage)<br />
            Dim clrMatrix As ColorMatrix = _<br />
                      New ColorMatrix(New Single()() _<br />
                           {New Single() {1, 0, 0, 0, 0}, _<br />
                            New Single() {0, 1, 0, 0, 0}, _<br />
                            New Single() {0, 0, 1, 0, 0}, _<br />
                            New Single() {0, 0, 0, 0.5F, 0}, _<br />
                            New Single() {0, 0, 0, 0, 1}})<br />
<br />
            Dim imgAttributes As ImageAttributes = New ImageAttributes()<br />
            imgAttributes.SetColorMatrix(clrMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap)<br />
<br />
            g.DrawImage(bitmap, New Rectangle(0, 0, Me.Width, Me.Height), _<br />
            0, 0, bitmap.Width, bitmap.Height, _<br />
            GraphicsUnit.Pixel, imgAttributes)<br />
            ' Dispose<br />
            g.Dispose()<br />
<br />
            'imgAttributes.SetColorMatrix(clrMatrix,<br />
            'ColorMatrixFlag.Default,<br />
            'ColorAdjustType.Bitmap);<br />
<br />
        End Sub<br />

AnswerRe: extended picturebox Pin
Dave Kreskowiak1-Nov-07 14:30
mveDave Kreskowiak1-Nov-07 14:30 
QuestionReference DLL in VB.NET 2003 Pin
kendo171-Nov-07 13:05
kendo171-Nov-07 13:05 
AnswerRe: Reference DLL in VB.NET 2003 Pin
Dave Kreskowiak1-Nov-07 13:38
mveDave Kreskowiak1-Nov-07 13:38 
GeneralRe: Reference DLL in VB.NET 2003 Pin
kendo171-Nov-07 14:58
kendo171-Nov-07 14:58 
QuestionDatabase connection Pin
s3rro1-Nov-07 10:31
s3rro1-Nov-07 10:31 
AnswerRe: Database connection Pin
Dave Kreskowiak1-Nov-07 10:37
mveDave Kreskowiak1-Nov-07 10:37 
AnswerRe: Database connection Pin
Paul Conrad1-Nov-07 15:53
professionalPaul Conrad1-Nov-07 15:53 
GeneralRe: Database connection Pin
Luc Pattyn1-Nov-07 16:02
sitebuilderLuc Pattyn1-Nov-07 16:02 
Questionuse PAINT method in TEXTBOX Pin
saeed_rezaei1-Nov-07 9:41
saeed_rezaei1-Nov-07 9:41 
AnswerRe: use PAINT method in TEXTBOX Pin
Luc Pattyn1-Nov-07 9:56
sitebuilderLuc Pattyn1-Nov-07 9:56 
AnswerRe: use PAINT method in TEXTBOX Pin
Christian Graus1-Nov-07 10:52
protectorChristian Graus1-Nov-07 10:52 
AnswerRe: use PAINT method in TEXTBOX Pin
Ajay.k_Singh1-Nov-07 11:18
Ajay.k_Singh1-Nov-07 11:18 
QuestionLimits of OpenFileDialog (Compact Framework) Pin
Hurricane30001-Nov-07 7:31
Hurricane30001-Nov-07 7:31 
QuestionAdding and nameing Columns To Datagrid Pin
FreakNikon1-Nov-07 4:06
FreakNikon1-Nov-07 4:06 
AnswerRe: Adding and nameing Columns To Datagrid Pin
AliAmjad1-Nov-07 4:37
AliAmjad1-Nov-07 4:37 
Questioninput validation Pin
Abbhie1-Nov-07 2:32
Abbhie1-Nov-07 2:32 
AnswerRe: input validation Pin
AliAmjad1-Nov-07 2:45
AliAmjad1-Nov-07 2:45 

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.