PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB20] Checkbox programming
[WB20] Checkbox programming
Débuté par Luis Antonio Gutiérrez Flores, 25 aoû. 2016 16:18 - 6 réponses
Posté le 25 août 2016 - 16:18
Good morning, have someone worked with checkbox in webdev? I need to replicate a check box list and fill each option with some information from a database, but the functions for handling check boxes aren't available in webdev. Any help?
Posté le 26 août 2016 - 08:11
Hi,

What do you want to do?

Please explain a bit more. I will be glad to take a look at it

regards
allard
Posté le 27 août 2016 - 11:50
Hi Luis,

The easiest way is to create a looper with a checkbox and a label on each row and link the looper to a file or query.

Regards,
Piet
Posté le 29 août 2016 - 15:58
Hello,

Don't know about WB but in WD I place one checkbox control and the use following code to clone it with a bit of indirection.
v is int sNewCtrl is string nWinHeight is int nWinWidth is int nConHeight is int nConwidth is int nRSCount is int CaptionSet is string sLastRowCreate is string nWinHeight=MyWindow..Height-CBOX_DocsReq1..Height-BTN_Ok..Height-50 nWinWidth=MyWindow..Width-CBOX_DocsReq1..Width nRSCount=HNbRec(docsreq)+1 HReadFirst(docsreq) FOR v = 2 TO nRSCount IF v = 2 THEN nConHeight=CBOX_DocsReq1..Y+CBOX_DocsReq1..Height nConwidth=CBOX_DocsReq1..X ControlClone(CBOX_DocsReq1,"CBOX_DocsReq" + NumToString(v),nConwidth,nConHeight) sNewCtrl = "CBOX_DocsReq1" sLastRowCreate="CBOX_DocsReq1" CaptionSet="CBOX_DocsReq1[1]" ELSE sNewCtrl = "CBOX_DocsReq" + (v - 1) CaptionSet="CBOX_DocsReq1"+ (v - 1)+"[1]" nConHeight={sNewCtrl,indControl}..Y+{sNewCtrl,indControl}..Height nConwidth={sNewCtrl,indControl}..X IF nConHeight>=nWinHeight THEN nConHeight={sLastRowCreate,indControl}..Y nConwidth={sLastRowCreate,indControl}..X+{sLastRowCreate,indControl}..Width sLastRowCreate="CBOX_DocsReq" + (v) END ControlClone(CBOX_DocsReq1,"CBOX_DocsReq" + NumToString(v),nConwidth,nConHeight) END {sNewCtrl,indControl}..Visible = True {sNewCtrl,indControl}[1]..Caption=NoSpace(docsreq.docreqName) {sNewCtrl,indControl}[1]..ReturnedValue=NoSpace(docsreq.docsreqID) HReadNext(docsreq)
The code is actually in a WD15 project.

HTH

Yogi Yang
Posté le 30 août 2016 - 00:42
In webdev we can't clone controls :(
Posté le 30 août 2016 - 00:43
I got it working with a table so no problem
Posté le 30 août 2016 - 14:21
Hi Luis,

You already found a working solution in WD20, but just that you know, since WB21 you can use ControlClone() in some specific circumstances and with some limitations. http://doc.windev.com/en-US/…

Best regards,
Alexandre Leclerc