Click here to Skip to main content
15,887,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A database contains all controls and their elements

We call the element AND the value of this element via the code.

Result: we can build, adapt, rebuild, make custom styles etc, in a couple of lines

These are the lines::

' an sql string to define the data
sql = "" : sql = "select * from config"

'Connecting to the data
rst = cns.OpenRecordset(sql)

'Our data has a certain number of fields
For i = 1 To rst.Fields.Count

'And here I lose it: Th database contains the right name of the element, but the use of it
Dim itm As GridItemCollection.element = rst.Fields(i).Name

'In our case the 'Grid.backcolor' is called because the database contains that word.

If this had worked, then certainly the below would've worked
IGrid1.itm = rst.Fields(i).Value

What I have tried:

Looked around, found nothing, Sen some questions on the web. Come here because you lovely people answer always.
Posted
Updated 15-Jun-19 16:40pm

1 solution

0) unless you’re using .Net, this will never work.

1) even if you do use .net, you’d have to make extremely heavy use of reflection. As a result, your app would absolutely suck in terms of performance.

2) if the controls you’re using ever become deprecated and disappear from your frameworks, your code would fail spectacularly, and we’d all laugh and point at you.

3) this is probably the worst (and absurd) idea I’ve ever heard, but you are using Visual Basic, so I guess it’s to be expected.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900