|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Call button click eventtxt1, txt2, txt3 and btn1, btn2 and btn3. When the user double clicked on the text box (txt1 to txt3), I will to click the corresponding buttons (btn1, btn2 or btn3). I can do the following in the text box double click event: select case sender.name case txt1.name: btn1.perform_click case txt2.name: btn2.perform_click case txt3.name: btn3.perform_click end select This works only if I know how many text boxes are in the form. If I load the text boxes and buttons at run time, may not know how many text boxes I have so I cannot use the Select Case statement to check for which text box is double clicked. I've try the following: Dim sv_str_BtnId As String Dim sv_ctl_Controls() as Button sv_str_BtnId = "btn" & Replace(sender.name, "txt", "") - this will return btn1 to btnX depending on whch text box is double clickedon. ' Now I try to find the controls. sv_ctl_Controls = Me.Controls.Find(sv_str_BtnId, False) If UBound(sv_ctl_Controls) <> -1 Then sv_ctl_Controls(0).PerformClick() End If This does not work at all - the button is not clicked. Can someone please help? On Fri, 22 May 2009 23:31:53 -0700, Young <young10***@hotmail.com> wrote:
> [...] Please, stop with the excessive cross-posting. You have been asked > Can someone please help? multiple times to not abuse the newsgroups, yet you continue to do so. Please stop. Eventually you may find no one willing to help you, as long as you can't be respectful of the community. Young wrote:
Show quoteHide quote > I've got a form with the following controls: In addition to Peter: (I've dropped two inappropriate groups from my reply)> > txt1, txt2, txt3 and btn1, btn2 and btn3. > > When the user double clicked on the text box (txt1 to txt3), I will > to click the corresponding buttons (btn1, btn2 or btn3). > > I can do the following in the text box double click event: > > select case sender.name > case txt1.name: btn1.perform_click > case txt2.name: btn2.perform_click > case txt3.name: btn3.perform_click > end select > > This works only if I know how many text boxes are in the form. If I > load the text boxes and buttons at run time, may not know how many > text boxes I have so I cannot use the Select Case statement to check > for which text box is double clicked. > > I've try the following: > > Dim sv_str_BtnId As String > Dim sv_ctl_Controls() as Button > sv_str_BtnId = "btn" & Replace(sender.name, "txt", "") - this will > return btn1 to btnX depending on whch text box is double clickedon. > > ' Now I try to find the controls. > sv_ctl_Controls = Me.Controls.Find(sv_str_BtnId, False) > > If UBound(sv_ctl_Controls) <> -1 Then > sv_ctl_Controls(0).PerformClick() > End If > > This does not work at all - the button is not clicked. > > Can someone please help? My 2c: I never understood why anybody wants to "perform a click". That's done by the user only. Performing a click by code is a detour. What you really want to do is: Double-clicking a Textbox performs the same action as clicking a button. (BTW, a plain-text message read and written using a fixed point font like Courier New is common practice) textbox doubleclick button click \ / +-------+-------+ | VAction So, the (p-)code is: sub textbox doubleclick handler call action end sub sub button click handler call action end sub sub action whatever end sub Consequently, you don't have to find a button in your Textbox' DoubleClick event handler. In addition, I've never cared about the name of a control (it's name property) at runtime. I do not say you mustn't, too, but I can easily identify a control by comparing the reference. This is safer because the compiler isn't able to find typos in string literals, and it's much faster. Therefore, I suggest using: if sender is txt1 then elseif sender is txt2 then elseif sender is txt3 then '... end if (BTW 2, names like "sv_str_BtnId" are hard to read) (BTW 3, "sv_ctl_Controls.Length <>0" can be used instead of "UBound(sv_ctl_Controls)<>-1") Armin "Armin Zingler" <az.nospam@freenet.de> wrote in message .. . . pardon?news:egRxFR52JHA.240@TK2MSFTNGP06.phx.gbl... > BTW, a plain-text message read and written using > a fixed point font like Courier New is common practice Mike Williams wrote:
> "Armin Zingler" <az.nospam@freenet.de> wrote in message ?> news:egRxFR52JHA.240@TK2MSFTNGP06.phx.gbl... > >> BTW, a plain-text message read and written using >> a fixed point font like Courier New is common practice > > . . . pardon? His message is displayed as HTML. If he display my message with a dynamic font also, my small "graphic" isn't displayed correctly. (I see now it's called "fixed-width font" in the US docs; if that was your point) Armin "Armin Zingler" <az.nospam@freenet.de> wrote in message No. My point was that your statement, "a plain text message using a fixed news:ONGo3652JHA.5728@TK2MSFTNGP03.phx.gbl... >>> BTW, a plain-text message read and written using >>> a fixed point font like Courier New is common practice >> >> [Mike wrote;] . . . pardon? > ? His message is displayed as HTML. If he display my message > with a dynamic font also, my small "graphic" isn't displayed > correctly. (I see now it's called "fixed-width font" in the US > docs; if that was your point) point font like Courier New" seems to be self contradictory, at least as far as the author of the message is concerned. To my own mind a plain text message is exactly that, a plain text message, and it therefore contains no font information at all, in the same way that a standard .txt file contains no font information. Unless newsgroups deal with such things differently (which I suspect they do not) then as far as a plain text message is concerned it is up to the app that displays the message at the receiving end to determine the font that is used to display the plain text, and the choice of font at the viewing end is therefore something over which the author of the plain text message has no control. Perhaps you meant to say, "a HTML message with the font set to a fixed width font"? Mike Mike Williams wrote:
> I did not write this! I wrote "*read and written* using a fixed point font". >>>> BTW, a plain-text message read and written using >>>> a fixed point font like Courier New is common practice >>> >>> [Mike wrote;] . . . pardon? > >> ? His message is displayed as HTML. If he display my message >> with a dynamic font also, my small "graphic" isn't displayed >> correctly. (I see now it's called "fixed-width font" in the US >> docs; if that was your point) > > No. My point was that your statement, "a plain text message using a > fixed point font like Courier New" seems to be self contradictory, You are creating a wrong context by improperly leaving out parts of the sentence. Armin Armin,
What did you write to Herfried lately? You did it 95% perfect, not as perfect as Mike W of course but if you both want to discuss this OT thing, I think he can do this better in a German newsgroup. :-) CorCor Ligthert[MVP] wrote:
> Armin, .. . . pardon?> > What did you write to Herfried lately? > > You did it 95% perfect, not as perfect as Mike W of course but if you > both want to discuss this OT thing, I think he can do this better in > a German newsgroup. > > :-) Armin Was written wrong, my intention was:
You both can maybe better discuss if you were using correct English in a German newsgroup. It is always easy for a native English speaker to discuss with persons like us if something is right written in English or not. But as we use our own native language it becomes suddenly a bit easier, you write well English so why would Mike not try it once in German. Seems to me a fair deal Cor Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:OlbImm82JHA.3476@TK2MSFTNGP05.phx.gbl... > Cor Ligthert[MVP] wrote: >> Armin, >> >> What did you write to Herfried lately? >> >> You did it 95% perfect, not as perfect as Mike W of course but if you >> both want to discuss this OT thing, I think he can do this better in >> a German newsgroup. >> >> :-) > > . . . pardon? > > > > Armin Cor Ligthert[MVP] wrote:
> Was written wrong, my intention was: I understand your words but I don't see what it should tell me. Anyway, it's > > You both can maybe better discuss if you were using correct English > in a German newsgroup. > > It is always easy for a native English speaker to discuss with > persons like us if something is right written in English or not. > > But as we use our own native language it becomes suddenly a bit > easier, you write well English so why would Mike not try it once in > German. > Seems to me a fair deal OT. Armin "Armin Zingler" <az.nospam@freenet.de> wrote in message No I'm not. I'm not creating a wrong context at all. You are the one who is news:uNFr2u62JHA.4744@TK2MSFTNGP04.phx.gbl... > I did not write this! I wrote "*read and written* using a > fixed point font". You are creating a wrong context by > improperly leaving out parts of the sentence. wrong. You were chastising the OP for failing to use a fixed width font in his message. You said, "a plain-text message read and written using a fixed point font like Courier New is common practice". But it isn't possible for the OP to write a "plain text" message using a "fixed point" font, so you were wrong to chastise him for failing to do so. If the OP sends a "plain text" message then it is up to YOU (not the OP) to decide what font you wish to read it in! The OP has no control over that whatsoever. So if you are chastising him then you are chastising him for your own failure! The OP could have written a HTML message using a fixed width font (and then it would appear at your end as fixed width unless you specifically chose not to display the message that format, which would certainly not be the OP's fault!). But that is NOT what you said. What you said was WRONG. Why don't you just admit it and stop wriggling about in your attemp to defend the indefensible! Mike Mike Williams wrote:
> "Armin Zingler" <az.nospam@freenet.de> wrote in message No, you did leave out the desivice parts of the sentence! Therefore you've> news:uNFr2u62JHA.4744@TK2MSFTNGP04.phx.gbl... > >> I did not write this! I wrote "*read and written* using a >> fixed point font". You are creating a wrong context by >> improperly leaving out parts of the sentence. > > No I'm not. I'm not creating a wrong context at all. created the wrong context. Everybody can read it. I cite you again: "a plain text message using a fixed point font like Courier New". Everybody can read that I did not write this. > You were chastising the OP Quote my words that indicate "chasting". If you can't then stop youallegations. > for failing to use a fixed Quote my words that indicate a "failure". If you can't then stop you> width font in his message. allegations. > You said, "a plain-text message read and I meanwhile corrected it to "fixed width" font. Apart from this, it wouldn't> written using a fixed point font like Courier New is common > practice". But it isn't possible for the OP to write a "plain text" > message using a "fixed point" font, be my problem if he wasn't able to do it (however I think he is). I am able to read and write plain text messages using a fixed width font. I always do it. Even right at the moment. > so you were wrong to chastise him Quote my words that indicate a "failure". Quote my words that indicate> for failing to do so. "chasting". > If the OP sends a "plain text" message then it Correct.> is up to YOU (not the OP) to decide what font you wish to read it in! > The OP has no control over that whatsoever. So if you are chastising Failure in what? In telling him that plain text messages read and written> him then you are chastising him for your own failure! using a fixed width font is common practice? If you'd once bother to read this sentence _thoroughly_ again, you might start to understand what it really says. I suggest not skipping some words again. Well, let me give you a hand with analyzing this simple sentence for you: "a plain-text message read and written using a fixed width font" Which information do we have here? First, it says it's a plain text message. Second, it says that a fixed width font has been used (or should be used) while writing/reading the message (which is usually a display setting in your newsreader). These are two independent pieces of information. Both are correct. Nowhere is written that the message contains font information. YOU were the one that left out a part of the sentence that made it express something different. > The OP could The OP's first post contained both, a plain text part and an HTML part. To> have written a HTML message keep the OP from getting a wrong display of my little "painting", I gave him a general hint about what's common practice. Just in advance - because I'm so attentive. > and stop wriggling about in your You'd better stop citing me wrong and blaming me for a wrong statement of an> attemp to defend the indefensible! incorrectly quoted sentence! Sorry to everyone else for this superfluous OT discussion, but I'm not willing to let the well known troll's allegations unanswered. This is my last statement about it. Armin "Armin Zingler" <az.nospam@freenet.de> wrote in message You seem to be completely missing the point. If it is a plain text message news:%233jOTx$2JHA.240@TK2MSFTNGP06.phx.gbl... > > "a plain-text message read and written using a fixed width font" > > Which information do we have here? First, it says it's a plain text > message. Second, it says that a fixed width font has been used > (or should be used) while writing/reading the message (which is > usually a display setting in your newsreader). These are two > independent pieces of information. Both are correct. then it does not matter whether or not the editor used to produce it was using a fixed width font or not, because the message will be just plain text. For such a message the author of the message has no control whatsoever over what kind of font is used by the person who is reading his it. That choice is entirely up to the person reading it. Therefore your statament "a plain text message /read and written/ using a fixed width font" is nonsensical, because for a plain text message it does not matter what font it was /written/ in. Also, both yourself and your cohort Cor Ligthert were clearly "ganging up" on the OP and chastising him for what you both perceived to be his failure to code properly and his failure to post his messages in accordance with your own specified set of rules. Perhaps your Germanic behaviour of moving around in gangs and attacking others who you perceive to be weaker than yourself has caused me to mistakenly believe that you were also chastising him failing to draft his message in accordance with your own strict rules, or perhaps there has been a misunderstanding because of the fact that English is obviously not the first language of either of you, but either way I think you both owe the OP an apology. Mike
Show quote
Hide quote
"Mike Williams" <M***@WhiskyAndCoke.com> wrote in message It does matter. If the text is attempting to portray a diagram (as was the news:%23rk9$PF3JHA.1716@TK2MSFTNGP03.phx.gbl... > "Armin Zingler" <az.nospam@freenet.de> wrote in message > news:%233jOTx$2JHA.240@TK2MSFTNGP06.phx.gbl... >> >> "a plain-text message read and written using a fixed width font" >> >> Which information do we have here? First, it says it's a plain text >> message. Second, it says that a fixed width font has been used >> (or should be used) while writing/reading the message (which is >> usually a display setting in your newsreader). These are two >> independent pieces of information. Both are correct. > > You seem to be completely missing the point. If it is a plain text message > then it does not matter whether or not the editor used to produce it was > using a fixed width font or not, because the message will be just plain > text. subject post of this subthread) then the font used to prepare the message will determine the characters and character spacing that the writer will use to ensure that the diagram conveys the message they wanted to convey. The font used is a critical component in the process of using multiple lines of text to draw a diagram, and in making that diagram intelligible. > For such a message the author of the message has no control whatsoever Correct. This is why it is so important to prepare it using a font that the > over what kind of font is used by the person who is reading his it. reader of the message is likely to use, or can be advised to use, in order that the reader will see the diagram displayed correctly. > That choice is entirely up to the person reading it. Yes. That's why it is important to provide some advice to the person reading it as to what font was used to prepare the message. Or, in a more general situation, to provide advice as to what font it is generally used by people posting in newsgroups when preparing diagrams using multiple lines of text, as in the relevant post. Following that advice gives the reader the best chance that the diagram will display correctly. > Therefore your statament "a plain text message /read and written/ using a No. For the reasons set out above the font the message was written in is > fixed width font" is nonsensical, because for a plain text message it does > not matter what font it was /written/ in. critical to the correct display of the diagram by the recipient. > Also, both yourself and your cohort Cor Ligthert were clearly "ganging up" No. You should read the thread from the beginning. No-one is ganging up on > on the OP and chastising him for what you both perceived to be his failure > to code properly and his failure to post his messages in accordance with > your own specified set of rules. Perhaps your Germanic behaviour of moving > around in gangs and attacking others who you perceive to be weaker than > yourself has caused me to mistakenly believe that you were also chastising > him failing to draft his message in accordance with your own strict rules, > or perhaps there has been a misunderstanding because of the fact that > English is obviously not the first language of either of you, but either > way I think you both owe the OP an apology. OP. Advising OP of what common practice is does not amount to a chastisement. The information about what is common practice is correct. It was provided in the context of being important to a correct interpretation of the diagram that was included in the post. If OP had not been aware that the diagram was prepared using a fixed-width font, the OP may not have read the diagram correctly and may have wondered what the odd squggles were trying to demonstrate. The advice to read the message using a plain text display in a fixed width font was relevant to ensuring that the reader of the message understood the contents. Therefore it is not a chastisement, and there is no ganging up. Show quoteHide quote > Mike > > > Armin,
Your original comment about the OP plain/text, fixed-font, confused me too. But then I realized you were probably viewing in HTML mode. The OP had mixed MIME message - plain/text and HTML content type. The reader, based on your settings, will use only one part to display. If you have HTML mode, then text/html MIME part will be displayed. If you have TEXT mode, then text/plain MIME part will be displayed. I use to use to use OE6 too long ago and you don't have the option to use one mode over the other per folder. (I don't think ThunderBird doesn't) Thunderbird has 3 view modes: Original HTML Simple HTML (no images, javascript) Plain Text So when you made that comment, you probably had OE6 set for HTML viewing which is really dangerous in the open message forums. BTW, I agree with you. For Technical Programming message forums, fixed pitch fonts should be used to help with code formatting, otherwise you have zagged alignment. And no way should a poster use HTML only. It will appear as a blank message for readers that have HTML disabled. Many forum software will filter HTML to avoid the issues of security. The MS NNTP News servers does no HTML mime part filtering. Hope this info creates world peace. :-) -- Show quoteHide quoteArmin Zingler wrote: > Mike Williams wrote: >> "Armin Zingler" <az.nospam@freenet.de> wrote in message >> news:uNFr2u62JHA.4744@TK2MSFTNGP04.phx.gbl... >> >>> I did not write this! I wrote "*read and written* using a >>> fixed point font". You are creating a wrong context by >>> improperly leaving out parts of the sentence. >> >> No I'm not. I'm not creating a wrong context at all. > > No, you did leave out the desivice parts of the sentence! Therefore you've > created the wrong context. Everybody can read it. I cite you again: "a > plain > text message using a fixed point font like Courier New". Everybody can > read that I did not write this. > > >> You were chastising the OP > > Quote my words that indicate "chasting". If you can't then stop you > allegations. > >> for failing to use a fixed >> width font in his message. > > Quote my words that indicate a "failure". If you can't then stop you > allegations. > >> You said, "a plain-text message read and >> written using a fixed point font like Courier New is common >> practice". But it isn't possible for the OP to write a "plain text" >> message using a "fixed point" font, > > I meanwhile corrected it to "fixed width" font. Apart from this, it > wouldn't > be my problem if he wasn't able to do it (however I think he is). I am able > to read and write plain text messages using a fixed width font. I always do > it. Even right at the moment. > >> so you were wrong to chastise him >> for failing to do so. > > Quote my words that indicate a "failure". Quote my words that indicate > "chasting". > >> If the OP sends a "plain text" message then it >> is up to YOU (not the OP) to decide what font you wish to read it in! > > Correct. > >> The OP has no control over that whatsoever. So if you are chastising >> him then you are chastising him for your own failure! > > Failure in what? In telling him that plain text messages read and written > using a fixed width font is common practice? If you'd once bother to read > this sentence _thoroughly_ again, you might start to understand what it > really says. I suggest not skipping some words again. Well, let me give > you a hand with analyzing this simple sentence for you: > > "a plain-text message read and written using a fixed width font" > > Which information do we have here? First, it says it's a plain text > message. > Second, it says that a fixed width font has been used (or should be used) > while writing/reading the message (which is usually a display setting in > your newsreader). These are two independent pieces of information. Both > are correct. Nowhere is written that the message contains font information. > YOU were the one that left out a part of the sentence that made it express > something different. > > >> The OP could >> have written a HTML message > > The OP's first post contained both, a plain text part and an HTML part. To > keep the OP from getting a wrong display of my little "painting", I gave > him a general hint about what's common practice. Just in advance - because > I'm so attentive. > > >> and stop wriggling about in your >> attemp to defend the indefensible! > > You'd better stop citing me wrong and blaming me for a wrong statement > of an > incorrectly quoted sentence! > > > Sorry to everyone else for this superfluous OT discussion, but I'm not > willing to let the well known troll's allegations unanswered. This is my > last statement about it. > > > Armin > Armin Zingler wrote:
> Mike Williams wrote: Didn't see this comment before. I see your point. Right. Never mind >> The OP could >> have written a HTML message > > The OP's first post contained both, a plain text part and an HTML part. To > keep the OP from getting a wrong display of my little "painting", I gave > him a general hint about what's common practice. Just in advance - because > I'm so attentive. my previous post. :-) It will probably help to note such things when drawing a diagram: Note: The following diagram should be viewed on plain text or a fixed pitch font. So to better see it, change the Message View mode in your reader to plain text. But as Michael W pointed out, the reader might have plain text setup to use Microsoft Ariel by default. I changed mine to Courier New simply because I too like to draw text graphics and outlines. :-) -- And?
Show quoteHide quote "Mike" <unkn***@unknown.tv> wrote in message news:%23GEMO8F3JHA.4880@TK2MSFTNGP03.phx.gbl... > Armin Zingler wrote: >> Mike Williams wrote: > >>> The OP could >>> have written a HTML message >> >> The OP's first post contained both, a plain text part and an HTML part. >> To >> keep the OP from getting a wrong display of my little "painting", I gave >> him a general hint about what's common practice. Just in advance - >> because >> I'm so attentive. > > Didn't see this comment before. I see your point. Right. Never mind my > previous post. :-) > > It will probably help to note such things when drawing a diagram: > > Note: The following diagram should be viewed on plain text or > a fixed pitch font. So to better see it, change the Message > View mode in your reader to plain text. > > But as Michael W pointed out, the reader might have plain text setup to > use Microsoft Ariel by default. I changed mine to Courier New simply > because I too like to draw text graphics and outlines. :-) > > -- What do I become decent, I did not write all of those what Pete and you
wrote. I simply have removed the groups and set it to plain text Do you think there is something wrong with me? :-) CorYoung wrote:
> I've got a form with the following controls: (I'm going to assume you have '2005, so I'll use Generics, but a > > txt1, txt2, txt3 and btn1, btn2 and btn3. > > When the user double clicked on the text box (txt1 to txt3), I will to > click the corresponding buttons (btn1, btn2 or btn3). Hashtable would work almost as well). How about this? Private m_LinkedButtons as Dictionary(Of TextBox, Button) = Nothing Sub Form_Load( ... ) m_LinkedButtons.Add( txt1, btn1 ) m_LinkedButtons.Add( txt2, btn2 ) m_LinkedButtons.Add( txt3, btn3 ) . . . Now, you can directly access each button based on its associated textbox. Private Sub TB_DoubleClick( ... ) If Typeof sender is TextBox Then Dim tb as TextBox = DirectCast( sender, TextBox ) if m_LinkedButtons.ContainsKey( tb ) then m_LinkedButton( tb ).PerformClick() end if end if end Sub And yes; use PerformClick - that's the way we're /supposed/ to "click" buttons from code now - but remember that it's subject to all the same restrictions as an interactive user would be; the button has to be visible (I think) and enabled (definitely) for PerformClick to do anything. HTH, Phill W.
Using function with PChar data type
Visual Studio 2008 and Classes Inheriting From System.Web.UI.WebControls.Style Problem with embedded carriage returns trouble reading word documents Good tutorial for working with XML how to know if to close sqlreader still problems reading word documents... Build Number - how to auto increment? Question on system.mail.net and formatting mail body Structure with List(Of) Exception !? |
|||||||||||||||||||||||