some of you may remember that i made text editor program designed for book writing (look for a topic named "Blank line at end of textfile" to refresh your memory if needed
so it all work *almost* great and i'm finding new ways to improve it and that lead me to my first question:
1) i was thinking about adding a system that hold a list of words for easy writing.
so insted of having to write certian words that repeat themselves many times i could just click a button and add them.
such system is easy: just a file holding the word list,code to load it into listbox and a button with code for checking what word was selected and add it into the textbox where the rest of the text is.
however what if i want to insert a word in the middle of the text? just marking the area where i'd want to insert wont work sice the correct code will add the word in the end of the text.
so is there a way to let the program know where i want to insert it?
the correct idea for code i have is this:
Private sub button_Click() 'code for checking what word was selected 'word selected placed inside string variable lets say TmpWord text1.text = text1.text & TmpWord end sub
now to my other question:
i noticed that when holding the backspace button the program start deleting more text then what i want and that force me to tap on the button.
i think the problem might be here but i'm not so sure:
Private Sub counter() num_words = 0 in_word = False For I = 1 To Len(Text1.Text) ch = Mid$(Text1.Text, I, 1) Select Case ch Case " ", vbTab, vbCr, vbLf in_word = False Case Else If Not in_word Then in_word = True num_words = num_words + 1 End If End Select Next I Label1.Caption = num_words If num_words < MaxWords Then Label1.ForeColor = vbBlack Call unblocker Err = False ElseIf num_words >= MaxWords Then Call blocker(num_words) Label1.ForeColor = vbRed Err = True End If End Sub
this code count how many words there are inside the textbox.
i cant debug in IDE because i'm kinda lazy to change all the reference to the INI file to be on specifice location and then having to change again before compiling
some light will be nice

New Topic/Question
Reply



MultiQuote





|