English
Source / code snippets

create List view

 

RudiB.
code time run aufbereitet....
'Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) into Babyklappe on XProfan.com stored:
'List view create
 $I profalt.inc
DEF @GetSysColor(1) !"USER32","GetSysColor"
Settruecolor 1
Declare CLASSNAME$,LVHandle&,OK&,LVC#,TXT$,Text#,Text&,LVI#,Chosen&
Declare Columntext#,Line#,LVITEM#,List_Text#,Line1$,Line2$,Line3$,Style&
Windowstyle 31
Windowtitle "A little ListView"
Window 0,0-640,440
CLS @getsyscolor(15)
LET OK&=@CREATEBUTTON(%HWND,"OK",10,360,100,30)
LET CLASSNAME$="SysListView32"
Let Style&=$40000000+$10000000+$0001+$0200+$8
LET LVHandle&=@Control(CLASSNAME$,"",Style&,20,20,300,300,%HWND,0,%Hinstance)
@sendmessage(LVHandle&,$1036,0,$20+$1)'show lines, select full row
@sendmessage(LVHandle&,$1036,0,$20+$1+$4)'show checkboxes,show lines, select full row
Dim LVC#,24
DIM Columntext#,256
String Columntext#,0="Column 1"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String $(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),1,LVC#)
String Columntext#,0="Column 2"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String $(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),2,LVC#)
String Columntext#,0="Column 3"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String $(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),3,LVC#)
Dispose Columntext#

Proc Get_List_Text

    Parameters LV_HANDLE&,List_Index&,ColumnIndex&
    Declare ERG$
    Dim Line#,36
    DIM List_Text#,256
    CLEAR Line#
    long Line#,0=$1
    long Line#,8=ColumnIndex&
    long Line#,4=List_Index&
    long Line#,20=List_Text#
    long Line#,24=256
    @sendmessage(LV_HANDLE&,$1005,List_Index&,Line#)
    Let ERG$=@String $(List_Text#,0)
    Dispose Line#
    Dispose List_Text#
    Return ERG$

Endproc

DIM LVI#,36
Dim Columntext#,256
Clear LVI#
String Columntext#,0="Line 1 / Column 1"
Long LVI#,0=$0001
Long LVI#,4=0
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string $(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,1,LVI#)
String Columntext#,0="Line 2 / Column 2"
Long LVI#,0=$0001
Long LVI#,4=1
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string $(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,1,LVI#)
String Columntext#,0="Line 3 / Column 1"
Long LVI#,0=$0001
Long LVI#,4=2
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string $(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,2,LVI#)
String Columntext#,0="Line 1 / Column 3"
Long LVI#,0=$0001
Long LVI#,4=0
Long LVI#,8=2
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string $(Columntext#,0))
@sendmessage(LVHandle&,$1000+46,0,LVI#)
String Columntext#,0="Line 3 / Column 2"
Long LVI#,0=$0001
Long LVI#,4=2
Long LVI#,8=1
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string $(Columntext#,0))
@sendmessage(LVHandle&,$1000+46,2,LVI#)
Dispose Columntext#
Dispose LVC#
Dispose LVI#

While 0=0

    IF @getfocus(OK&)

        LET Chosen&=@sendmessage(LVHandle&,$100C,-1,2)
        LET Chosen&=Chosen&+1

        IF Chosen&<>0

            Get_List_Text LVHandle&,Chosen&-1,0
            LEt Line1$=@$(0)
            Get_List_Text LVHandle&,Chosen&-1,1
            LEt Line2$=@$(0)
            Get_List_Text LVHandle&,Chosen&-1,2
            LEt Line3$=@$(0)
            @messagebox("Text in column 1: "+Line1$+"Text in column 2: "+Line2$+"Text in column 3: "+Line3$,"Line "+@st$(Chosen&)+" has been chosen!",64)

        endif

    endif

wend

'--------------------------------------------------------------------------------
'regards
 
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
03/31/20  
 




Jörg
Sellmeyer
I Have time the Lib\ rausgenommen, then runs it yet universeller. I take at times, not everyone has its Includes in the Ordner Lib but eachone has whom Ornder in the Profan-Suchpfad.
 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/28/20  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.579 Views

Untitledvor 0 min.
Gast.081510/12/24
Walter06/19/24
Hans Neff01/24/23
Michael Borowiak11/29/22
More...

Themeninformationen

this Topic has 2 subscriber:

Jörg Sellmeyer (1x)
RudiB. (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie