Question Developing a bible verse search program

chazrab

Member
Joined
Nov 11, 2022
Messages
23
Programming Experience
10+
The Listbox on the userform finally populated. But what's in it? It(Listbox1) should display the rows and
columns of the Access database in the other snip below. I feel like I'm finally getting somewhere with this.
Seems like something like a simple change somewhere, either in Access or in VS - like a setting, maybe - that will
finally allow the Listbox to display the rows and columns. BTW - this data hs 31,103 rows across 4 columns
KJV, NIV, NASB, RSV are the column headers( simply version translations) which I did not put in the Access DB. I guess I could add them later - as long as the VS Listbox will always reflect any changes made to the underlying
Access db.
THE FOLLOWING MAY BE A BORING COMMENT TO YOU BUT IT IS JUST A SELF ENCOURAGED HOPE:

This is the furtherest I've gotten in learning the ins and outs of VS and it's pretty exciting to be able to expand the creative abilities without the limitations I've had in a VBA IDE.

From what little I've learned so far, the learning curve should speed up much faster for me. Using C# to add objects to a userform and coding the objects to do what a user wants in VS seems pretty much identical to the coding objects in Excel/VBA. The Listbox is the rowsource for displaying Biblical text verses in custom designed textboxes. Different buttons perform different operations. No big deal.

Main challenge ( which is not possible with a VBA linked textbox ) is writing C# code to tell VS when to start and end red text in a userform textbox between "markers", be they quotes or something else.

A Rich Text Box in VBA does allow that but all the red text substrings have to be hard coded in the coding and I don't feel that the developers of VBA did much to improve the capabilities of a VBA RTB.

There should be an easier, more simple and elegant way to do this in VS and therein lies my one major goal for learning VS . I've reached an important development limitation in VBA - which is why I'm putting the effort in to learn VS. Thanks very much for your prompt and continued help. Sorry for being so wordy. cr, Kingwood, Tx
 

Attachments

  • WELL - THE LISTBOX FINALLY POPULATED.  BUT WHATS SYSTEM.DATAROWVIEW.jpg
    WELL - THE LISTBOX FINALLY POPULATED. BUT WHATS SYSTEM.DATAROWVIEW.jpg
    60.8 KB · Views: 33
  • ACCESS DATABASE.  SHEET2 IS TABLE NAME.jpg
    ACCESS DATABASE. SHEET2 IS TABLE NAME.jpg
    390.4 KB · Views: 34
Sorry I'm late responding. Finally got this little example of adding names to a listbox and sorting them
in A-Z and Z-A order with simple button code. The .Count issue solved itself when I started over and went slowly.
Simple, but works great. As mentioned earlier, I need to start slow and learn how to populate a Listbox with Excel sheet data or data in a database. I am studying your design suggestions you mentioned above. Since I can only speak intelligently in Excel/VBA terms( and I know is a C# forum), the entire 31,103 rows of verses from Gen to Rev are in one sheet. Even with an i7 processor and 12 GB Ram, the FIND method does not produce instantaneous results( but within about 2 secs).

Not to be redundant but
Any Bible application has these main functions - 1 - Search for any value(FIND method or Autofilter method in VBA), 2 - display the results in a multiline textbox or multiple textboxes on the same form for versions comparisons, 3 - add notes if desired to the search results. Anything else is just a matter or sorting, enhancing fonts, etc. to display search results text of a verse, word, chapter or phrase and then .

In my application FIND just copies the results to a new sheet(named RESULTS) , table or database that can be renamed and saved. The RESULTS sheet, table or database is then emptied to prepare for another search. So I designed it as a simple holding container for performing searches and just copying to a new sheet, table or database and displaying the results in a large userform multiline textbox with "spaces" between multiple verses. I've done all this in VBA.

Now I have to teach myself how to do this in C#. The last challenge, and most important is displaying the Words of Jesus Christ in the NT in red text in userform textbox. That simply cannot be done in VBA. The author of Wordsearch and I communicated via email, and although he is doing other things now, he told me that Wordsearch was developed in C#. Wordsearch gave(it no longer exists, having been acquired by Logos) the user the option of displaying the Words of Jesus in red. There are about 3,000 of His Words in the NT.

So all that said, I know I have an uphill challenge awaiting me. It's been done before many times, so it does seem achievable for me in this lifetime .

Thanks once again for the time you've put into this to help guide me. cr.
 

Attachments

  • ELEMENTARY EXAMPLE WORKS.jpg
    ELEMENTARY EXAMPLE WORKS.jpg
    227.6 KB · Views: 17
I need to start slow and learn how to populate a Listbox with Excel sheet data or data in a database
This was pretty much exactly what the posted example application did with its sheet, btw.

If you want to do it with a DB it's a little more involved but extensions like EF COre Power Tools really help

If I was looking to color different words differently I might either use an RichTextBox, or perhaps even a web browser control and preformat my verses with colors: 24:2 <span class="jesus">"Do you see all these things?"</span> he asked - if you store the formatting with the span baked into the text, you can change them from black/red just by altering the color setting for the .jesus class (note, I mean CSS / HTML class, not C# class)
 
Last edited:
Even with an i7 processor and 12 GB Ram, the FIND method does not produce instantaneous results
No, but an i7 does read the bible very quickly :D - and if you use an evolved search strategy like indexing words (full text searching) it will be faster than 2 seconds
 
Really good feedback. You seem very experienced s well as having a full understanding what I'm after. Even though some, if not all, may take a dim view of snip images in forum threads, to me they really help(in some cases) to explain things better and clearer than words. I'm just anxious to get rolling on this to the shortest distance between two points - the completed Bible application built in C# with red text options. Thanks again - cr
 
Don't fixate on red text on white background. If you look at the various guidelines for developing code for people with visual impairments, red on white background or white on red background is not recommended due to there not being enough contrast difference between white and red.

 
Definitely think, if you have a list of His words, that storing the text as HTML with the words already highlighted in a suitable color will make for easy display - especially if you later move it to be a web based app
 
Back
Top Bottom