| General > General Technical Chat |
| Visual Basic components to simulate 7 segment and LEDs? |
| (1/2) > >> |
| CraigAB:
Hi, Does anyone know of any free Visual Basic (any version) components (OCX, ActiveX, DLL) that can simulate 7 segment displays, LED's and switches? The only ones that I can find are the paid versions. Regards, Craig |
| Psi:
Are you looking for something that "looks pretty", or just something usable for teaching. Writing your own would be pretty easy if all you need to do is draw lines on the canvas to represent whatever segment of the 7-seg is being told to turn on. There are also many fonts available that show all possible numbers/letters for a 7seg display digit. So that might be an option. I've never seen one that shows all possible segment combinations, but one might exist. |
| CraigAB:
Cheers mate. I suppose looking pretty would be nice, but not necessary. I am not sure where to start to create a component/control that would update like a 7 segment or even an LED. I can probably hack my way through the code side. Do you have any pointers to creating such a control? Just so you know, it was a 6809 trainer from Microtec, Ferndale Productions, originally used by Box Hill TAFE in Victoria Australia in the early 1990's that, for the longest time, I wanted to create a simulator for. Regards, Craig |
| mariush:
OCX / ActiveX are deprecated technologies, I doubt anyone still supports these in Windows 10 and newer. Also Visual Basic ... even the .net versions are no longer priority for Microsoft... move on. |
| Psi:
If it was Delphi I could help, but i know sfa about Visual Basic. It should be pretty simple though, look up an example on creating a visual component. Get that working and then modify so it draws lines on the screen from point A to B based on what segment is being requested by the calling method. It wont look super pretty, but you could improve it by drawing 3 parallel lines with the center one a bit longer at each ends. So the ends look more like a 7 seg. etc.. If that will look good enough really depends on what you need it for. Another option is to use an existing component that accepts images, or an array of them. Then you just need to get a big image that has all possible combinations of segments and make a lookup table to copy the right one out of the image and onto the screen at a specific location. I dunno about visual studio but Delphi lets you easily copy a subsection of a bigger image onto the screen with a single command. |
| Navigation |
| Message Index |
| Next page |