プレゼントを何にするか迷った結果、ふなっしーにしました^ω^



プレゼント


以上、終わり!!!




あと、このカップラーメンおいしくなさそうw

久々にアクセス解析してみたら、「DateTimePicker 背景色」の方ばかりだったので一応ソース置いときます。(掲示板荒れてたし…w)


Public Class DateTimePickerCustomize
     Inherits DateTimePicker

    Private ReadOnly WM_PAINT As Integer = &HF

    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
         ' ↓先に、既定の描画処理をさせる
        MyBase.WndProc(m)
         If m.Msg = Me.WM_PAINT Then
             Me.Redraw()
         End If
     End Sub

    Public Function GetControlImage() As Bitmap
         ' 自分自身の画像をBitmapにコピー
        Dim bmp As New Bitmap(Me.Width, Me.Height)
         Me.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Width, Me.Height))
         ' Bitmapの背景色をMe.BackColorに変更する
        Using g As Graphics = Graphics.FromImage(bmp)
             Dim cm As Imaging.ColorMap() = {New Imaging.ColorMap}
             cm(0).OldColor = SystemColors.Window
             cm(0).NewColor = Me.BackColor
             Dim ia As New Imaging.ImageAttributes()
             ia.SetRemapTable(cm)
             Dim r As New Rectangle(0, 0, bmp.Width, bmp.Height)
             g.DrawImage(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height), _
                         0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, ia)
         End Using

        Return bmp
     End Function

    Private Sub Redraw()
         ' Bitmapを自分の上に描画する
        Dim bsz As Size = SystemInformation.Border3DSize
         Using g As Graphics = Me.CreateGraphics, bmp As Bitmap = Me.GetControlImage
             g.DrawImage(bmp, -bsz.Width + 2, -bsz.Height + 2)
         End Using
     End Sub

End Class


前に書いた記事

http://ameblo.jp/momosakurahime/entry-11109237277.html