Jump to content

UD Spread Sheet Control


 Share

Recommended Posts

I am almost done with the part that makes the spreadhseet control.

But, it won't automaticly scroll. How do I get it so that when you move the scroll bars it goes to another part of the sheet.

Don't modify anything except what is required to make it scroll.

Your name will autmoaticly be appended to the Author heading.

;Script: UDCtrl_Spreadsheet
;Author: Guido Arbia
;Description: Enables the ussage of a spreadsheet.

;This control is excempt from any built in GUI Functionality meaning that you will not be able
;to perform any standard GUI methods on it, such as GUICTRLSETDATA.

#include <GUIConstants.AU3>

$TestWindow = GUICreate("Hello World!",640,480)
GUISetState(@SW_SHOW)

$Poopy = UDCtrlCreateSpreadSheet(10,10,100,20,0,0,640,480,$TestWindow)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

Func UDCtrlCreateSpreadSheet($Cols,$Rows,$ColWidth,$RowHeight,$X,$Y,$Width,$Height,$ParentWindow)
   $SpreadSheet = GUICreate("",$Width,$Height,$X,$Y,$WS_CHILD+$WS_VISIBLE+$WS_VSCROLL+$WS_HSCROLL,0,$ParentWindow)
   
   Assign($SpreadSheet&"_ColWidth",$ColWidth,2)
   Assign($SpreadSheet&"_RowHeight",$RowHeight,2)
   
   Dim $SSData[$Cols+1][$Rows+1]
   
   For $ColumnIndex = 1 to $Cols
      For $RowIndex = 1 to $Rows
         $SSData[$ColumnIndex][$RowIndex] = GUICtrlCreateInput("",$ColWidth*($ColumnIndex-1)+2,$RowHeight*($RowIndex-1)+2,$ColWidth,$RowHeight)
      Next
   Next
   
   Assign($SpreadSheet&"_Data",$SSData,2)
   
   Return $SpreadSheet
EndFunc
I used to have over 700 posts. This is a new account. I am not a newbie.My AutoIt Home Page - Here is all my AutoIt stuff. Well, actually, I have loads more, I am just too lazy to put it on my page right now so deal with it.Guess what? The unvierse is made out of basically nothing.Think about it? What is the smallest building block of anything, it is what? A chunk of nothingness. Thats all. Hey this peice of space is a forperborb and it is so.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...