Click here to Skip to main content
15,906,333 members
Home / Discussions / C#
   

C#

 
GeneralRe: Type.GetType("System.Drawing.Color") returns null?! Pin
Arun Bhalla21-Oct-03 12:16
Arun Bhalla21-Oct-03 12:16 
Generalmanaged + unamanaged directx Pin
gonenb21-Oct-03 8:20
gonenb21-Oct-03 8:20 
GeneralRe: managed + unamanaged directx Pin
Jeremy Kimball24-Oct-03 5:32
Jeremy Kimball24-Oct-03 5:32 
GeneralRe: managed + unamanaged directx Pin
gonenb24-Oct-03 6:46
gonenb24-Oct-03 6:46 
GeneralRe: managed + unamanaged directx Pin
gonenb30-Oct-03 4:29
gonenb30-Oct-03 4:29 
GeneralThreads appear twice Pin
AJB...21-Oct-03 6:39
AJB...21-Oct-03 6:39 
GeneralRe: Threads appear twice Pin
James Simpson24-Oct-03 2:03
James Simpson24-Oct-03 2:03 
QuestionEditcontrol GUI widget.. Any Tips? Pin
kfowlks21-Oct-03 4:32
kfowlks21-Oct-03 4:32 
Hello, All

I'm in the process of writing a custom editcontrol GUI Widget. e.g. TextControl. I currently have a control that users can enter text and highligh text etc. I'm running into 2 problems listed below.

Problem #1

When trying to invert the color of the text when a line is selected sometimes the text drawn over the black text does not align if i only draw a subset starting in the middle.
If i select the entire line then it works perfectly.

1) It appears that when using DrawString if you draw 2 text lines for example:

First Line: Hello, This is a sample text line
offset = measureString(Hello, This is )

// -- draw x with offset on line
invert text: a sample text

this leads me to belive that char's are draw with a differnt about of leading space if draw in differnt contexts. So the width of ie and i + e is not equal.

Does anyone know another solution to this?

Problem #2

This is my first time attempting to code a editcontrol
from scratch so what is the proper tecnique for painting the control. Currently the screen us refreshing every line on each keypress. Basiclly, I'm drawing text line by line. All drawing is currently done in the Paint event. Does anyone know a better way?

Thanks,








Confused | :confused:

Kevin Fowlks
Programmer Analyst
Michigan State University
Center for Remote Sensing & GIS

AnswerRe: Editcontrol GUI widget.. Any Tips? Pin
J. Dunlap21-Oct-03 12:14
J. Dunlap21-Oct-03 12:14 
GeneralRe: Editcontrol GUI widget.. Any Tips? Pin
kfowlks22-Oct-03 4:16
kfowlks22-Oct-03 4:16 
General__LINE__ Pin
Rick Crone21-Oct-03 3:53
Rick Crone21-Oct-03 3:53 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 5:51
Rick Crone21-Oct-03 5:51 
GeneralRe: __LINE__ Pin
Heath Stewart21-Oct-03 6:39
protectorHeath Stewart21-Oct-03 6:39 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 7:53
Rick Crone21-Oct-03 7:53 
GeneralRe: __LINE__ Pin
Heath Stewart21-Oct-03 8:36
protectorHeath Stewart21-Oct-03 8:36 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 9:43
Rick Crone21-Oct-03 9:43 
GeneralRe: __LINE__ Pin
leppie21-Oct-03 8:42
leppie21-Oct-03 8:42 
GeneralRe: __LINE__ Pin
J. Dunlap21-Oct-03 9:01
J. Dunlap21-Oct-03 9:01 
QuestionHow can I get graphics through message WM_NCPAINT ? Pin
wangier20-Oct-03 23:24
wangier20-Oct-03 23:24 
AnswerRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart21-Oct-03 6:41
protectorHeath Stewart21-Oct-03 6:41 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier21-Oct-03 15:08
wangier21-Oct-03 15:08 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart21-Oct-03 18:57
protectorHeath Stewart21-Oct-03 18:57 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier21-Oct-03 23:40
wangier21-Oct-03 23:40 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart22-Oct-03 2:59
protectorHeath Stewart22-Oct-03 2:59 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier22-Oct-03 15:44
wangier22-Oct-03 15:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.