Results 1 to 4 of 4

Thread: can I do this more easily

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Nelson, New Zealand
    Posts
    4

    Talking can I do this more easily

    HI
    I am nearly finished writing my first VB project and I am trying to
    put some help in for the user. This help is activated by clicking an
    image with HELP on it and the message that appears will give help about the button or text box that has focus. I have done the code, which does work, below but it seems a very long way of doing it. The project has 8 forms and this form only has 6 controls that require help. Some of of the other forms have 10 text boses and 4 buttons on them so that code will be really long.


    Private Sub CmdHelp_MouseDown(Button As Integer, Shift As Integer, X
    As Single, Y As Single)
    'makes image depress like button
    CmdHelp.Appearance = 1
    End Sub


    Private Sub CmdHelp_MouseUp(Button As Integer, Shift As Integer,
    X As Single, Y As Single)
    'makes image rise like button when mouse button is released
    CmdHelp.Appearance = 0

    If Me.ActiveControl.Name = frmSaleReturn.grdPatronType.Name Then
    GeneralHelp "grdPatronType"
    Exit Sub
    End If
    If Me.ActiveControl.Name = frmSaleReturn.grdSeatsForRefund.Name
    Then
    GeneralHelp "grdSeatsForRefund"
    Exit Sub
    End If
    If Me.ActiveControl.Name = frmSaleReturn.grdSeatsForSale.Name Then
    GeneralHelp "grdSeatsForSale"
    Exit Sub
    End If
    If Me.ActiveControl.Name = frmSaleReturn.CmdClose.Name Then
    GeneralHelp "Close"
    Exit Sub
    End If
    If Me.ActiveControl.Name = frmSaleReturn.cmdRefund.Name Then
    GeneralHelp "cmdRefund"
    Exit Sub
    End If
    If Me.ActiveControl.Name = frmSaleReturn.cmdSell.Name Then
    GeneralHelp "cmdSell"
    Exit Sub
    End If

    End Sub

    Please help

    Gary

  2. #2
    AIS_DK
    Guest
    Each control, has what is called a tooltip. It is activated when the mouse hovers over a control for a short while.

    Under the properties for the different control, you will find a field called ToolTip. Try putting som text into this field, start your program, and let your cursor hover (the cursor must be over the control, but must not be moved) over this control.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Nelson, New Zealand
    Posts
    4

    Thanks but...

    As well as the tool tips that are already in the project I want contextual help. This means that what ever control has focus will get a good help message so that a new user can work the application with little or no insructions from me. The help is on small form with a label that loads on mouse down of the help image and gets the short help message from a database. The help form has a help button on it so the user can get more comperehensive if required.
    it is just the loading of the help form that seems to take a lot of code and there must be an easier way to do it.

    Gary

  4. #4
    Junior Member
    Join Date
    Aug 2001
    Location
    MidCentral ( Between MidWest and MidEast)
    Posts
    19
    You could make an access database and have 3 fields
    1 Form
    2 Item
    3 Message

    Call the table HlpCntx

    open a connection and on mouse over query the table for current for and item and return the message. This will also allow you to distrubute new help without a new .exe


    Select Message from HlpCntx where (Form = Form.name) and (Item = me.activecontrol.name)


    Ideally you would add this code to a module and call it.

    Public function Get_HlpMsg(byval frmForm as string, byval frmItem as string)

    ....
    ....
    Get_HlpMsg = MESSAGE

    end function

    Hope this idea helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width