Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Question on Setting Focus- Urgent!

Posted on 1999-07-14
9
Medium Priority
?
136 Views
Last Modified: 2010-05-02
I have a project where I am using a slider control from greentree, when I click or slide the slider up and down, a ugly focus appears on the slider- (dotted lines)  I tried looking into changing when a user clicks or slides the control it would send the focus to a button- but it still blinks once when the user first slides!   how can I do away with the ugly dotted lines?  Can I shut it off directly inside the form, How-  Your help would be awesome~!
0
Comment
Question by:CindyGraves
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1524805
set the TabIndex property of slider to a value greater than the value of another control that has a TabIndex property... also set the TabStop property of the slider to False... that should do it...
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1524806
that does'nt work . . it still get's focus when a user clicks it, hence displaying the focus rect.  I hav'nt found a way yet, other than setting the forms backcolor to black . . but who would want to do that?
0
 
LVL 1

Author Comment

by:CindyGraves
ID: 1524807
That did not work, I even tried setting the form to black and still no success!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Expert Comment

by:jgv
ID: 1524808
Here's a quick and dirty way to do it. Draw four text boxes on the form. Remove the text, set the border style to 0-none, the backcolour to your forms backcolour and set the tabstop to false. Move and size the boxes so that they cover the outer area of the slider (where the focus rectangle would be). Cheap, but it works :o)
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1524809
I was j/k about that black form thing.  jgv's answer is a pain, but may be the only way.
0
 
LVL 4

Expert Comment

by:wylliker
ID: 1524810
There is a GDI function - DrawFocusRect - This will draw the focus rectangle normally done automatically by windows (and VB)  but this draw is an XOR operation such that calling it twice will remove the rectangle.

Such that if you call this directly and VB calls it intrinsically, effectively the focus rectangle will be removed.

It may be possible to call this function in the focus event and it may be fast enough to not cause a flicker - you would have to experiment - There is some work to do (a few api calls) in terms of getting the control's window rect and the device context for it. GetWindowRect and GetWindowDC respectively.

The question really comes down to whether there would be significant flicker associated with it.

0
 
LVL 10

Accepted Solution

by:
viktornet earned 100 total points
ID: 1524811
the guy that said about the DrawFocusRect() is correct,... you can also prevent the focus....
like in OnFocus() of the slider put some code like this....

SomeOtherControl.SetFocus

..-=ViKtOr=-..
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1524812
that was pretty low viktor...
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1524813
hey, Beedle shitty... didn't I tell you already that you're my problem and stop messing around with me, eh? now get a life... i can do WHATEVER i want, and you're not the one who can stop me...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question