BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-29-2008, 04:45 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to turn off select highlight on LabelField

Please Login to Remove!

When I focus on a LabelField, it becomes "highlighted". Is there a simple way to turn that off, so it looks the same with and without focus?

I have tried overriding paint and changing the background color, but this doesn't work at all.

Not sure what to do, or how to use HIGHLIGHT_FOCUS.
Offline  
Old 07-29-2008, 05:52 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Figured it out... but was HIGHLIGHT_FOCUS (not select) I was trying to turn off. For others, this is what I did:

Code:
tab1 = new LabelField(tab1Label, tabStyle) {
	protected void drawFocus(Graphics g, boolean on){
		XYRect rect = new XYRect();
		getFocusRect(rect);
		drawHighlightRegion(g, HIGHLIGHT_FOCUS, false, rect.x, rect.y, rect.width, rect.height);
	}
};
Works like a charm. I'm finally grasping the API docs.
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.