Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 1 Jahr, 1 Monat
Letzter Beitrag:
vor 1 Jahr, 1 Monat
Beteiligte Autoren:
Luis Antonio Gutiérrez Flores, Alexandre Leclerc, Yogi Yang, Piet van Zanten, Allard

[WB20] Checkbox programming

Startbeitrag von Luis Antonio Gutiérrez Flores am 25.08.2016 14: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?

Antworten:

Hi,

What do you want to do?

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

regards
allard

von Allard - am 26.08.2016 06:11
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

von Piet van Zanten - am 27.08.2016 09:50
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

von Yogi Yang - am 29.08.2016 13:58
In webdev we can't clone controls :(

von Luis Antonio Gutiérrez Flores - am 29.08.2016 22:42
I got it working with a table so no problem

von Luis Antonio Gutiérrez Flores - am 29.08.2016 22:43
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/?3025017

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 30.08.2016 12:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.