|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CommandButton!Usually when a CommandButton on a VB6 Form is clicked, a square (with
all the 4 sides having dotted lines) appears on the just clicked CommandButton. Is there any way to get rid of that square on the CommandButton? Thanks, Arpan Why would you?
-- Show quoteChris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp Veign's Blog http://www.veign.com/blog -- "Arpan" <arpan***@hotmail.com> wrote in message news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... > Usually when a CommandButton on a VB6 Form is clicked, a square (with > all the 4 sides having dotted lines) appears on the just clicked > CommandButton. Is there any way to get rid of that square on the > CommandButton? > > Thanks, > > Arpan > "Arpan" <arpan***@hotmail.com> wrote in message It's called a focus rect! You can't get rid of it!news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... > Usually when a CommandButton on a VB6 Form is clicked, a square (with > all the 4 sides having dotted lines) appears on the just clicked > CommandButton. Is there any way to get rid of that square on the > CommandButton? > > Thanks, > > Arpan > Jim Edgar! If there's another control on the form, you can do the
following: Private Sub Command1_Click() 'Do all the stuff you need to for the Click event, then set focus upon 'another control... The dotted lines appear ONLY while the button 'is pressed down and disappear when focus is set to another 'control. So set the focus to another control as the last item of the '_Click or DoubleClick event. Call Text1.SetFocus End Sub The rectangle is noticed for a moment and ends up disappearing. Another option would be to use the Command1_MouseUp event to set focus upon another control. Yet another option that might work for you involves using a PictureBox control and capturing a picture of the command button. The HTML Help Image Editor works great for getting a picture of any control or form. You can edit the picture captured of the pressed button to get rid of the dotted rect and switch between loading the pressed and unpressed images. For the PictureBox, get rid of the Border, set the Appearance property to a flat look instead of 3-D, set the AutoSize to True. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Picture1.Picture = LoadResPicture(1001, vbResBitmap) 'Picture1.Picture = LoadPicture(AppendBackSlash(App.Path) & "Cmd1_P.bmp") End Sub Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Picture1.Picture = LoadResPicture(1002, vbResBitmap) 'Picture1.Picture = LoadPicture(AppendBackSlash(App.Path) & "Cmd1_U.bmp") End Sub Hope this helps. -- Jim Carlock Post replies to the newsgroup, thanks. "Jim Edgar @cox.net>" <djedgar<removethis> wrote: It's called a focus rect! You can't get rid of it!"Arpan" <arpan***@hotmail.com> wrote: > Usually when a CommandButton on a VB6 Form is clicked, a square (with > all the 4 sides having dotted lines) appears on the just clicked > CommandButton. Is there any way to get rid of that square on the > CommandButton? > > Thanks, > > Arpan > Jim Edgar!
Show quote
>"Arpan" <arpan***@hotmail.com> wrote in message Well..... Actually, you can (but maybe shouldn't). ;-)>news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... >> Usually when a CommandButton on a VB6 Form is clicked, a square (with >> all the 4 sides having dotted lines) appears on the just clicked >> CommandButton. Is there any way to get rid of that square on the >> CommandButton? >> >> Thanks, >> >> Arpan >> > >It's called a focus rect! You can't get rid of it! > >Jim Edgar! For an example of how it's done, have a look at the Remove Focused Rect example at http://www.mvps.org/vbvision/ HTH, Bryan _______________________________ Bryan Stafford New Vision Software newvision_don'tspam@mvps.org I didn't find the words: Rectangle or Focus on the page...
http://www.mvps.org/vbvision/ I found "Remove" but I'm not going to give you any points for those "Remove"'s. -- Show quoteJim Carlock Post replies to the newsgroup, thanks. "alpine" <alpine_don'tsendspam@mvps.org> wrote: Well..... Actually, you can (but maybe shouldn't). ;-)>"Arpan" <arpan***@hotmail.com> wrote in message >news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... >> Usually when a CommandButton on a VB6 Form is clicked, a square (with >> all the 4 sides having dotted lines) appears on the just clicked >> CommandButton. Is there any way to get rid of that square on the >> CommandButton? >> >> Thanks, >> >> Arpan >> > >It's called a focus rect! You can't get rid of it! > >Jim Edgar! For an example of how it's done, have a look at the Remove Focused Rect example at http://www.mvps.org/vbvision/ HTH, Bryan _______________________________ Bryan Stafford New Vision Software newvision_don'tspam@mvps.org Google found it...
remove focused rectangle site:mvps.org/vbvision http://www.mvps.org/vbvision/grouped_demos.htm -- Jim Carlock Post replies to the newsgroup, thanks. 'Try this
Private Const WM_KILLFOCUS As Long = &H8 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub Command1_GotFocus() SendMessage Command1.hwnd, WM_KILLFOCUS, 0, 0 End Sub "Arpan" <arpan***@hotmail.com> wrote in message Unless you're creating a touch-screen application, DON'T DO IT. This news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... > Usually when a CommandButton on a VB6 Form is clicked, a square (with > all the 4 sides having dotted lines) appears on the just clicked > CommandButton. Is there any way to get rid of that square on the > CommandButton? rectangle is important to people who use the keyboard. Believe it or not, there are people out there who prefer the keyboard over the mouse. Good programmers accommodate ALL their users. On Thu, 20 Oct 2005 08:55:33 -0400, "Jeff Johnson [MVP: VB]" <i.get@enough.spam> in <e9XUQWX1FHA.2***@TK2MSFTNGP09.phx.gbl> wrote: Show quote > Mouse? What's that? Oh, you mean that carpal tunnel inducing device?>"Arpan" <arpan***@hotmail.com> wrote in message >news:1129768422.778144.76410@f14g2000cwb.googlegroups.com... > >> Usually when a CommandButton on a VB6 Form is clicked, a square (with >> all the 4 sides having dotted lines) appears on the just clicked >> CommandButton. Is there any way to get rid of that square on the >> CommandButton? > >Unless you're creating a touch-screen application, DON'T DO IT. This >rectangle is important to people who use the keyboard. Believe it or not, >there are people out there who prefer the keyboard over the mouse. Good >programmers accommodate ALL their users. > --- Stefan Berglund > Mouse? What's that? Oh, you mean that carpal tunnel inducing What... you don't think a keyboard can contribute to carpal tunneldevice? problems? Rick "Rick Rothstein [MVP - Visual Basic]" <rickNOSPAMnews@NOSPAMcomcast.net> I tell ya.... I've been "computing" for 25 years... never had a problem... wrote in message news:u8SMFNZ1FHA.3376@TK2MSFTNGP14.phx.gbl... >> Mouse? What's that? Oh, you mean that carpal tunnel inducing > device? > > What... you don't think a keyboard can contribute to carpal tunnel > problems? > > Rick then, I got a laptop. Now I have problems (mostly sore wrists). If it weren't so darned cumbersome, I'd have a "real" keyboard (link to best keyboard on earth below) hooked up to my laptop at all times.... but then, I'd have a "desktop" and I could've saved a few bucks eh? <g> I use a white one at home and a black one at work. http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=021 -- Ken Halter - MS-MVP-VB - http://www.vbsight.com DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Please keep all discussions in the groups.. "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message Is that so you'll remember where you are? Must be a "cushy" job :-)news:%23f2XoXZ1FHA.2008@TK2MSFTNGP10.phx.gbl... > I use a white one at home [keyboard] and a black one at work. Mike "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message LOL <g>... nah, it's actually because I have a black PC/Monitor at work and news:dj8lga$afg$1@news6.svr.pol.co.uk... > "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message > news:%23f2XoXZ1FHA.2008@TK2MSFTNGP10.phx.gbl... > >> I use a white one at home [keyboard] and a black one at work. > > Is that so you'll remember where you are? Must be a "cushy" job :-) > > Mike a "cream" colored at home. -- Ken Halter - MS-MVP-VB - http://www.vbsight.com DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Please keep all discussions in the groups.. On Thu, 20 Oct 2005 12:28:13 -0400, "Rick Rothstein [MVP - Visual Basic]"
<rickNOSPAMnews@NOSPAMcomcast.net> wrote: in <u8SMFNZ1FHA.3***@TK2MSFTNGP14.phx.gbl> >> Mouse? What's that? Oh, you mean that carpal tunnel inducing I've used a keyboard for 35 years and played the piano for 53 years and never>device? > >What... you don't think a keyboard can contribute to carpal tunnel >problems? > >Rick > have a problem unless I forget and start clicking the mouse. Then my fingers go numb. I normally use keyboard shortcuts for everything and no problem. --- Stefan Berglund "Stefan Berglund" <keepit@in.thegroups> stated... Yeah, those are neat pianos with the keyboard shortcut that> I've used a keyboard for 35 years and played the piano for > 53 years .... I normally use keyboard shortcuts for > everything and no problem. makes the piano play the song by itself... -- Jim Carlock Post replies to the newsgroup, thanks. On Thu, 20 Oct 2005 23:05:08 -0400, "Jim Carlock" <anonymous@localhost> wrote: in <eL8X1ye1FHA.3***@TK2MSFTNGP12.phx.gbl> >"Stefan Berglund" <keepit@in.thegroups> stated... LOL. Disklavier is a great learning tool for students because it can reproduce>> I've used a keyboard for 35 years and played the piano for >> 53 years .... I normally use keyboard shortcuts for >> everything and no problem. > >Yeah, those are neat pianos with the keyboard shortcut that >makes the piano play the song by itself... touch and feel with such exactness, but it lacks personality and doesn't do requests. --- Stefan Berglund |
|||||||||||||||||||||||