Results 1 to 7 of 7

Thread: [RESOLVED] dynamic

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2006
    Location
    Jerusalem
    Posts
    39

    Resolved [RESOLVED] dynamic

    morning,

    im working on dynamic forms and im facing real big problems.. I am creating an application similar to visual basic.

    so when i create a dynamic control (run-time), I want its properties to appear in the buttom left corner as in VB. i created MSFlexGrid and its filled according to the selected control by getting its properties from a database i filled manually.

    the problem is some of vb controls are changed by comboBox and some you just fill them in ( Text Box )

    for ex. cmdButton , (name) : (textbox) .. appearance : (comboBox)

    is that clear?

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: dynamic

    do you have any unique code/name for each control loaded on the form...if so, cant you fecth the details of the selected control from the database and display it in the grid...could you post your code
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2006
    Location
    Jerusalem
    Posts
    39

    Re: dynamic

    i can fetch details from database and i have done so..

    to be more specific , I want to fill my MSFlexGrid with data exactly like "VB.6" properties table/grid .. some cells have textboxes to fill in ( i used hidden textbox an aligned it to selected cell ) and other cells just have comboBoxes and some (like picture) you have to click a button to browse and select a pic.

  4. #4
    Member
    Join Date
    Nov 2006
    Posts
    43

    Re: dynamic

    You have to have a hidden textbox and a hidden combobox and depending on the text in the left column of the flexgrid you show one of them at position
    flexgrid.top + flexgrid.rowpos(flexgrid.row), flexgrid.left + flexgrid.colpos(flexgrid.col)

    You can save the property values in the events Lostfocus and keypress where keyascii = 13 (return key)
    This will require some trial and error before it runs smoothly.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2006
    Location
    Jerusalem
    Posts
    39

    Re: dynamic

    thanx

    but still, how can i insert a browse button to the cell like the picture property?

  6. #6
    Member
    Join Date
    Nov 2006
    Posts
    43

    Re: dynamic

    Same procedure as for the textbox and combobox, add a hidden command button to the form. When you select the row that has the text "picture" or "image" in the left column you will move the textbox and browse button to the coordinates of the current cell and make them visible.
    You have to decrease the width of the textbox by the width of the browse button and put the browse button at the same top position as the textbox and at the left position of the textbox + the width of the textbox.

    For Example:
    VB Code:
    1. if grdProperties.textmatrix(grdproperties.row,0) = "Picture" then
    2. txtProperties.move grdProperties.left + grdProperties.Colpos(1), grdProperties.top + grdProperties.Rowpos(grdProperties.row),txtProperties.height, grdProperties.ColWidth(0) - cmdBrowse.width
    3. cmdBrowse.move txtProperties.Left + txtProperties.width, txtProperties.top
    4. txtProperties.visible=true
    5. cmbBrowse.visible=true
    6. end if

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2006
    Location
    Jerusalem
    Posts
    39

    Re: dynamic

    thank you.

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