Click here to Skip to main content
15,889,659 members

miwuawen - Professional Profile



Summary

    Blog RSS
134
Authority
3
Debator
3
Enquirer
163
Organiser
459
Participant
0
Author
0
Editor
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
General[Winform] mouse to drag the dashed box, reduce the window drawing Pin
miwuawen3-Jun-12 4:03
miwuawen3-Jun-12 4:03 
Generalvb.net Rounded form that can change the background picture Pin
miwuawen28-May-12 23:14
miwuawen28-May-12 23:14 
This is a rounded form, you can implement a button to replace the background picture

Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Drawing.Drawing2D
Imports System.Linq
Imports System.Runtime.InteropServices

Public Class Form1

Const CS_DropSHADOW As Integer = &H20000
Const GCL_STYLE As Integer = (-26)
'声明Win32 API
<dllimport("user32.dll", charset:="CharSet.Auto)"> _
Public Shared Function SetClassLong(ByVal hwnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
End Function
<dllimport("user32.dll", charset:="CharSet.Auto)"> _
Public Shared Function GetClassLong(ByVal hwnd As IntPtr, ByVal nIndex As Integer) As Integer
End Function

'定义鼠标消息常量
Private Const WM_NCHITTEST As Integer = &H84
Private Const HT_LEFT As Integer = 10
Private Const HT_RIGHT As Integer = 11
Private Const HT_TOP As Integer = 12
Private Const HT_TOPLEFT As Integer = 13
Private Const HT_TOPRIGHT As Integer = 14
Private Const HT_BOTTOM As Integer = 15
Private Const HT_BOTTOMLEFT As Integer = 16
Private Const HT_BOTTOMRIGHT As Integer = 17
Private Const HT_CAPTION As Integer = 2
'处理Windows消息
Protected Overrides Sub WndProc(ByRef Msg As Message)
If Msg.Msg = WM_NCHITTEST Then
'获取鼠标位置
Dim nPosX As Integer = (Msg.LParam.ToInt32() And 65535)
Dim nPosY As Integer = (Msg.LParam.ToInt32() >> 16)
'右下角
If nPosX >= Me.Right - 6 AndAlso nPosY >= Me.Bottom - 6 Then
Msg.Result = New IntPtr(HT_BOTTOMRIGHT)
Return
'左上角
ElseIf nPosX <= Me.Left + 6 AndAlso nPosY <= Me.Top + 6 Then
Msg.Result = New IntPtr(HT_TOPLEFT)
Return
'左下角
ElseIf nPosX <= Me.Left + 6 AndAlso nPosY >= Me.Bottom - 6 Then
Msg.Result = New IntPtr(HT_BOTTOMLEFT)
Return
'右上角
ElseIf nPosX >= Me.Right - 6 AndAlso nPosY <= Me.Top + 6 Then
Msg.Result = New IntPtr(HT_TOPRIGHT)
Return
ElseIf nPosX >= Me.Right - 2 Then
Msg.Result = New IntPtr(HT_RIGHT)
Return
ElseIf nPosY >= Me.Bottom - 2 Then
Msg.Result = New IntPtr(HT_BOTTOM)
Return
ElseIf nPosX <= Me.Left + 2 Then
Msg.Result = New IntPtr(HT_LEFT)
Return
ElseIf nPosY <= Me.Top + 2 Then
Msg.Result = New IntPtr(HT_TOP)
Return
Else
Msg.Result = New IntPtr(HT_CAPTION)
Return
End If
End If
MyBase.WndProc(Msg)
End Sub

Public Sub SetWindowRegion()
Dim FormPath As System.Drawing.Drawing2D.GraphicsPath
FormPath = New System.Drawing.Drawing2D.GraphicsPath()
Dim rect As New Rectangle(0, 0, Me.Width, Me.Height)
FormPath = GetRoundedRectPath(rect, 10)
Me.Region = New Region(FormPath)
End Sub

Private Function GetRoundedRectPath(ByVal rect As Rectangle, ByVal radius As Integer) As GraphicsPath
Dim diameter As Integer = radius
Dim arcRect As New Rectangle(rect.Location, New Size(diameter, diameter))
Dim path As New GraphicsPath()

' 左上角
path.AddArc(arcRect, 180, 90)

' 右上角
arcRect.X = rect.Right - diameter
path.AddArc(arcRect, 270, 90)

' 右下角
arcRect.Y = rect.Bottom - diameter
path.AddArc(arcRect, 0, 90)

' 左下角
arcRect.X = rect.Left
path.AddArc(arcRect, 90, 90)
path.CloseFigure()
'闭合曲线
Return path
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'API函数加载,实现窗体边框阴影效果
SetClassLong(Me.Handle, GCL_STYLE, GetClassLong(Me.Handle, GCL_STYLE) Or CS_DropSHADOW)
End Sub

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim g As Graphics = Me.CreateGraphics
Dim pen As New Pen(Brushes.Gray, 1)
g.DrawLine(pen, 0, 0, 0, Me.Height)
g.DrawLine(pen, 0, 0, Me.Width, 0)
g.DrawLine(pen, Me.Width - 1, 0, Me.Width - 1, Me.Height)
g.DrawLine(pen, 0, Me.Height - 1, Me.Width, Me.Height - 1)
pen.Dispose()
End Sub

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
'采用界面二重缓冲
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.AllPaintingInWmPaint, True)
SetStyle(ControlStyles.UserPaint, True)
SetStyle(ControlStyles.DoubleBuffer, True)
Me.Refresh()
SetWindowRegion()
End Sub
Private curFileName As String = ""
Private curBitmap As Bitmap

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim opfile As New OpenFileDialog()
opfile.Title = "请选择一个图像"
opfile.Multiselect = True
opfile.Filter = "所有图像文件|*.jpg;*.png;*.bmp;*.gif"
If opfile.ShowDialog() = DialogResult.OK Then
Try
curFileName = opfile.FileName
curBitmap = DirectCast(Image.FromFile(curFileName), Bitmap)
Me.BackgroundImage = DirectCast(curBitmap, Image)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

End Class
Generalform of fade-over Pin
miwuawen28-May-12 23:07
miwuawen28-May-12 23:07 

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.