欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#給picturebox控件加圖片選中狀態(tài)的2個(gè)方法

 更新時(shí)間:2013年03月01日 14:59:25   作者:  
C#給picturebox控件加圖片選中狀態(tài)的2個(gè)方法,需要的朋友可以參考一下

方法一:

簡(jiǎn)單的方法就是改變picturebox 控件的borderstyle樣式

 currentSelectPicBox.BorderStyle = BorderStyle.Fixed3D;
            currentSelectPicBox.Refresh();//強(qiáng)制控件重新繪制

方法二

在picturebox控件加一個(gè)矩形框  但是這種方法在程序中反應(yīng)比較慢。

添加矩形框的方法:
            Graphics pictureborder = currentSelectPicBox.CreateGraphics();
            Pen pen = new Pen(Color.Red, 2);
            pictureborder.DrawRectangle(pen, currentSelectPicBox.ClientRectangle.X, currentSelectPicBox.ClientRectangle.Y, currentSelectPicBox.ClientRectangle.X + currentSelectPicBox.ClientRectangle.Width, currentSelectPicBox.ClientRectangle.Y + currentSelectPicBox.ClientRectangle.Height);
移除矩形框的方法

currentSelectPicBox.Invalidate();

如果大家有更好的方法 希望能夠跟咱 分享 

相關(guān)文章

最新評(píng)論