Prev: WorkBook Tab display mode of SpreadSheet control in VB 6.0
Next: how to bind a Chartspace to a specified worksheet in a Spreadsheet
From: Leo on 2 Jul 2010 05:47 Why am I getting this error for Me.ActiveControl.SelStart = InStr(Me.ActiveControl.SelStart, Me.ActiveControl.text, m_FR.FindWhat) - 1? If I replace Me.ActiveControl with the name of a textbox, it works but I am using two textboxes that I switch between depending on weather WordWrap is on or not. -- ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org
From: Larry Serflaten on 2 Jul 2010 06:02 "Leo" <ttdhead(a)gmail.com> wrote > Why am I getting this error for Me.ActiveControl.SelStart = > InStr(Me.ActiveControl.SelStart, Me.ActiveControl.text, m_FR.FindWhat) > - 1? If I replace Me.ActiveControl with the name of a textbox, it works > but I am using two textboxes that I switch between depending on weather > WordWrap is on or not. At the time of the error, what are the values of all those variables? My bet is that SelStart is 0, which won't work because strings start at position 1, so trying to start at position 0 raises an error.... :FS
From: Mayayana on 2 Jul 2010 09:34 If Larry's thought doesn't solve the problem: How do you know the active control isn't a button when you make the call? | Why am I getting this error for Me.ActiveControl.SelStart = | InStr(Me.ActiveControl.SelStart, Me.ActiveControl.text, m_FR.FindWhat) | - 1? If I replace Me.ActiveControl with the name of a textbox, it works | but I am using two textboxes that I switch between depending on weather | WordWrap is on or not.
From: Leo on 2 Jul 2010 09:40
on 7/2/2010, Mayayana supposed : > If Larry's thought doesn't solve the problem: > How do you know the active control isn't > a button when you make the call? > >> Why am I getting this error for Me.ActiveControl.SelStart = >> InStr(Me.ActiveControl.SelStart, Me.ActiveControl.text, m_FR.FindWhat) >> - 1? If I replace Me.ActiveControl with the name of a textbox, it works >> but I am using two textboxes that I switch between depending on weather >> WordWrap is on or not. Because the app is a specialised text editor with only a menu a common dialog and the textboxes. The issue is sorted -- ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org |