Jump to content

Recommended Posts

Posted

I am getting ready to write a program with Table-Form layout.  I need a window that contains a list of ITEMS, with buttons at the bottom for [insert],[update] and [Delete].  These buttons will open the Form window to complete the insert, update or delete.   I am not sure the best way to start this in AutoIt.  Does anyone know of some sample code or help window that would be helpful?

Thanks

  • Moderators
Posted

Where are you pulling the ITEMS from? I would start with a simple GUI, like below. Then, depending on how you want your items pulled in, you have a couple of options. The more you can tell us about what you're trying to do, the more we can assist :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
 
GUICreate("Test", 300, 300)

$btnInsert = GUICtrlCreateButton("Insert", 10, 260, 50, 30)
$btnUpdate = GUICtrlCreateButton("Update", 100, 260, 50, 30)
$btnDelete = GUICtrlCreateButton("Delete", 200, 260, 50, 30)
$lvItems = GUICtrlCreateListView("col1|col2", 10, 10, 100, 200)
 $items1 = GUICtrlCreateListViewItem("Item1|Item2", $lvItems)
 $items2 = GUICtrlCreateListViewItem("Item3|Item4", $lvItems)
 
GUISetState(@SW_SHOW)
 
    While 1
        Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
    ExitLoop
   case $btnInsert
    ;
  EndSwitch
    WEnd
GUIDelete()

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Thanks, I will play around with your sample.  I will be reading the ITEMs from a *.txt file.  One ITEM per line and fields separated by "|" 

Posted

Yes, this is perfect!!!   I looked at your code and then the help screens . 

 MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)

This line make it clear how to proceed.  I was not sure how my [update] button would know which ITEM to update.

Thanks Again.....

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...