1 / 20

المحاضرة الرابعة

المحاضرة الرابعة. كيانات برمجة البيزك المرئي Visual Basic Programming Objects By Hitham M. Abo Bakr. In the Previous Lecture s. Events in Programming VB . For Every VB Control a number of events, A programmer can implement some event by writing a code for these events

aviv
Download Presentation

المحاضرة الرابعة

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. المحاضرة الرابعة كيانات برمجة البيزك المرئي Visual Basic Programming Objects By Hitham M. Abo Bakr

  2. In the Previous Lectures

  3. Events in Programming VB • For Every VB Control a number of events, A programmer can implement some event by writing a code for these events • To Write event code, we need to open Code Window : • From View -> Code • Or double click on any control in the selected form

  4. Code Window Select Control Select events

  5. Event Procedure • Example: Label1.Caption = "Mouse coordinates are x= " & X & "y= " & Y Call event from another Event Private Sub Command1_Click() Label2.Caption = "The time now is" & Now End Sub Private Sub Form_Click() Command1_Click End Sub

  6. Menus and Toolbars Menu Toolbar Is a simple tool to access the program functionality

  7. Creating Menus To Create Menus in Visual Basic, We use Menu Editor tool “tool ->Menu Editor or Ctrl-E

  8. Build Simple Menu • We need to know what is the : • Caption • Name • Visible • Enable • Shortcut • Insert • Multilevel Menu

  9. Writing Code • The only available event for menu items is the click event • Example

  10. ToolBars To Create a toolbar we have to follow the following steps

  11. Creating Toolbar Steps

  12. Creating Toolbar Steps

  13. Creating Toolbar Steps

  14. Creating Toolbar Steps

  15. Creating Toolbar Steps

  16. Creating Toolbar Steps

  17. Creating Toolbar Steps

  18. Creating Toolbar Steps

  19. Creating Toolbar Steps Example Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) If Button.Index = 1 Then MsgBox "Button 1 clicked" ElseIfButton.Index = 2 Then MsgBox "Button 2 clicked" ElseIfButton.Index = 3 Then MsgBox "Button 3 clicked“ End If

  20. Thanks

More Related