




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、工具箱2Line Tool畫簡單的具有各種寬度和顏色的直線。與下面將要討論的各種繪圖工具一起用于裝飾應用程序。· Line Tool Properties:BorderColorDetermines the line color.BorderStyleDetermines the line 'shape'. Lines can be transparent, solid, dashed, dotted, and combinations.BorderWidthDetermines line width.Shape Tool· The shape tool c
2、an create circles, ovals, squares, rectangles, and rounded squares and rectangles. Colors can be used and various fill patterns are available.可以產生圓、橢圓、正方形、長方形、帶圓角的正方形和長方形。可以使用各種顏色的圖案填充這些圖形。· Shape Tool Properties:BackColorDetermines the background color of the shape (only used when FillStyle no
3、t Solid.BackStyleDetermines whether the background is transparent or opaque.BorderColorDetermines the color of the shape's outline.BorderStyleDetermines the style of the shape's outline. The border can be transparent, solid, dashed, dotted, and combinations.BorderWidthDetermines the width of
4、 the shape border line.FillColorDefines the interior color of the shape.FillStyleDetermines the interior pattern of a shape. Some choices are: solid, transparent, cross, etc.ShapeDetermines whether the shape is a square, rectangle, circle, or some other choice.Line和shape控件都沒有事件和方法。水平和垂直滾動條Horizontal
5、 and Vertical Scroll Bars對信息列表提供直觀的移動方式。水平和垂直滾動條都包括三個區域,如下所示。單擊End arrow的增量小,單擊Bar area的增量大,拖支Scroll box可以提供連續的移動。· Scroll Bar Properties:LargeChangeIncrement added to or subtracted from the scroll bar Value property when the bar area is clicked.MaxThe value of the horizontal scroll bar at the
6、far right and the value of the vertical scroll bar at the bottom. Can range from -32,768 to 32,767.MinThe other extreme value - the horizontal scroll bar at the left and the vertical scroll bar at the top. Can range from -32,768 to 32,767.SmallChangeThe increment added to or subtracted from the scro
7、ll bar Value property when either of the scroll arrows is clicked.ValueThe current position of the scroll box (thumb) within the scroll bar. If you set this in code, Visual Basic moves the scroll box to the proper position.水平滾動條的屬性圖示如下:垂直滾動條的屬性圖示如下:· Scroll Bar Events:ChangeEvent is triggered a
8、fter the scroll box's position has been modified. Use this event to retrieve the Value property after any changes in the scroll bar.ScrollEvent triggered continuously whenever the scroll box is being moved.例41華氏溫度轉換為攝氏度的應用程序C = (F - 32)*5/9Shape1:BackColorWhiteBackStyle1-OpaqueFillColorRedFillSt
9、yle7-Diagonal CrossShape4-Rounded Rectangle溫度初始值t32F 、 0COption ExplicitDim TempF As IntegerDim TempC As IntegerPrivate Sub vsbTemp_Scroll()'Read F and convert to CTempF = vsbTemp.ValuelblTempF.Caption = Str(TempF)TempC = CInt(TempF - 32) * 5 / 9)lblTempC.Caption = Str(TempC)End SubPrivate Sub v
10、sbTemp_Change()'Read F and convert to CTempF = vsbTemp.ValuelblTempF.Caption = Str(TempF)TempC = CInt(TempF - 32) * 5 / 9)lblTempC.Caption = Str(TempC)End SubPicture Boxes用于放置圖像,較適合放置動態圖像,如動畫,它非常像一個在form中的小form,它的大部分屬性與form一樣。· Picture Box Properties:AutoSizeIf True, box adjusts its size to
11、 fit the displayed graphic.FontSets the font size, style, and size of any printing done in the picture box.PictureEstablishes the graphics file to display in the picture box.· Picture Box Events:ClickTriggered when a picture box is clicked.DblClickTriggered when a picture box is double-clicked.
12、· Picture Box Methods:ClsClears the picture box.PrintPrints information to the picture box.ExamplespicExample.Cls ' clears the box picExamplepicExample.Print "a picture box" ' prints text string to picture boxpicExample.Picture = LoadPicture("c:pixsample.bmp")可以顯示如下5
13、種類型的圖像:.bmp, .ico (尺寸:32*32),.wmf(向量文件), .jpg, .gif Image Boxes與picture Box相似,它更適合放置靜態圖像。· Image Box Properties:PictureEstablishes the graphics file to display in the image box.StretchIf False, the image box resizes itself to fit the graphic. If True, the graphic resizes to fit the control area
14、.· Image Box Events:ClickTriggered when a image box is clicked.DblClickTriggered when a image box is double-clicked.不支持任何方法,但可以使用LoadPicture函數,而且也支持與bmp,ico,wmf,jpg,gif等類型的文件。Drive List Box允許用戶在運行時選擇一個有效的盤符。· Drive List Box Properties:DriveContains the name of the currently selected drive.
15、· Drive List Box Events:ChangeTriggered whenever the user or program changes the drive selection.Directory List Box以樹形結構顯示用戶所選擇盤符下的目錄結構。· Directory List Box Properties:PathContains the current directory path.· Directory List Box Events:ChangeTriggered when the directory selection is c
16、hanged.File List Box在運行時顯示Path屬性所指目錄下的文件列表。· File List Box Properties:FileNameContains the currently selected file name.PathContains the current path directory.PatternContains a string that determines which files will be displayed. It supports the use of * and ? wildcard characters. For example
17、, using *.dat only displays files with the .dat extension.MultiSelect允許用戶選擇多個文件· File List Box Events:DblClickTriggered whenever a file name is double-clicked.PathChangeTriggered whenever the path changes in a file list使Drive, Directory, 和 File List框三者同步在drive box 的change事件中:dirExample.Path = d
18、rvExample.Drive在directory box的 Change事件中filExample.Path = dirExample.Path如下代碼實現構建一個有效的帶有路徑名的文件名,并把它放置在image框中:Dim YourFile as StringIf Right(filExample.Path,1) = "" Then YourFile = filExample.Path + filExample.FileNameElse YourFile = filExample.Path + "" + filExample.FileNameEnd
19、IfimgExample.Picture = LoadPicture(YourFile)例42Image Viewer控件放置如下:File1:NamefilImagePattern*.bmp;*.ico;*.wmf;*gif;*jpg type this line with no spacesPrivate Sub drvImage_Change()'If drive changes, update directorydirImage.Path = drvImage.DriveEnd SubPrivate Sub dirImage_Change()'If directory
20、changes, update file pathfilImage.Path = dirImage.PathEnd SubPrivate Sub cmdShow_Click()'Put image file name together and'load image into image boxDim ImageName As String'Check to see if at root directoryIf Right(filImage.Path, 1) = "" Then ImageName = filImage.Path + filImage.
21、filenameElse ImageName = filImage.Path + "" + filImage.filenameEnd IflblImage.Caption = ImageNameimgImage.Picture = LoadPicture(ImageName)End SubCommon Dialog Boxes首先要添加此組件Microsoft Common Dialog Contro使用不同的方法,顯示不同的對話框:MethodCommon Dialog BoxShowOpenOpen dialog boxShowSaveSave As dialog bo
22、xShowColorColor dialog boxShowFontFont dialog boxShowPrinterPrinter dialog box· Open Dialog Box Properties:CancelErrorIf True, generates an error if the Cancel button is clicked. Allows you to use error-handling procedures to recognize that Cancel was clicked.DialogTitleThe string appearing in the title bar of the dialog box. Default is Open. In the example, the DialogTitle is Open Example.FileNameSets the init
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 加強合作2025年證券從業資格證試題及答案
- 圍繞項目管理考試的知識結構試題及答案
- 注冊會計師實務案例試題及答案
- 項目管理考試中的技能提升與試題答案
- 四川省雅安市本年度(2025)小學一年級數學統編版課后作業(下學期)試卷及答案
- 2025年注冊會計師技巧提升試題及答案
- 2025年證券從業資格證的備考心得試題及答案
- 行業分析與證券投資試題及答案
- 解析2025年證券從業資格證考試操作流程試題及答案
- 微生物檢驗中的法律法規試題及答案
- 《近代中國飲食變化》課件
- 實驗教學評價標準與反饋機制構建
- 2024版市政道路工程項目技術咨詢合同樣本3篇
- 2024年秋國開電大《法律咨詢與調解》形考任務1-4
- 廣東廣州市2025屆高考數學二模試卷含解析
- 針刺傷的防范與應急處理
- GB/T 44027.1-2024炭材料測定方法第1部分:首次放電比容量、首次庫侖效率、不同倍率放電容量保持率的測定
- 醫療機構醫療廢物管理規范考試試題及答案
- 《黑龍江省高爾夫球運動發展現狀調查研究》
- 2024年湖北省高考地理試卷真題(含答案逐題解析)
- 四年級語文下冊第六單元【集體備課】(教材解讀+教學設計)
評論
0/150
提交評論