Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: [Solved] UdpClient callback question Pin
Luc Pattyn15-Aug-10 7:40
sitebuilderLuc Pattyn15-Aug-10 7:40 
QuestionProcess and memory Pin
keloth8715-Aug-10 4:12
keloth8715-Aug-10 4:12 
AnswerRe: Process and memory Pin
Gary R. Wheeler15-Aug-10 5:29
Gary R. Wheeler15-Aug-10 5:29 
AnswerRe: Process and memory Pin
Luc Pattyn15-Aug-10 7:16
sitebuilderLuc Pattyn15-Aug-10 7:16 
QuestionReading data from HTTP Pin
Wamuti15-Aug-10 3:48
Wamuti15-Aug-10 3:48 
AnswerRe: Reading data from HTTP Pin
Nicholas Butler15-Aug-10 4:14
sitebuilderNicholas Butler15-Aug-10 4:14 
AnswerRe: Reading data from HTTP Pin
Not Active15-Aug-10 4:15
mentorNot Active15-Aug-10 4:15 
QuestionHow to customise the behaviour of a control when it is selected Pin
Dave Midgley15-Aug-10 2:54
Dave Midgley15-Aug-10 2:54 
I am developing a control that displays a grid of pictures. I want to be able to select a picture by clicking on it, and change its appearance (eg. with a border) to show that it is selected. I have created:
1. a class derived from UserControl that contains a PictureBox for the picture
2. a class derived from FlowLayoutPanel to contain the pictures. This overrides CreateControlsInstance() to return an instance of...
3. a class derived from Control.ControlCollection to contain the picture objects. This overrides the Add(Control value) method in order to add a handler to the Click event of the control being added to the collection. It also contains the click event handler, and this is where my problem lies:-
It seems to me that the logical next step is for the click event handler to identify the control that has been clicked (no problem) and to call its Select() method, which will then alter the appearance of the control as required. The problem is that Control.Select() cannot be overridden. This raises two questions:
Q1: what does Control.Select() actually do?
Q2: how do I implement the change in appearance of the control. Obviously I could just set the UserControl.BorderStyle property from within the click handler in collection class, but surely an object should make its own decision as to how it looks when it is selected.
I can only assume that I've misunderstood something, or am doing it all the wrong way. Can anyone advise?
Dave

QuestionLinq - Join Pin
treuveni15-Aug-10 2:50
treuveni15-Aug-10 2:50 
AnswerRe: Linq - Join Pin
Dan Mos15-Aug-10 3:30
Dan Mos15-Aug-10 3:30 
GeneralRe: Linq - Join Pin
treuveni15-Aug-10 4:17
treuveni15-Aug-10 4:17 
GeneralRe: Linq - Join Pin
Dan Mos15-Aug-10 4:30
Dan Mos15-Aug-10 4:30 
GeneralRe: Linq - Join Pin
treuveni18-Aug-10 5:52
treuveni18-Aug-10 5:52 
QuestionRegular Expressions [modified] Pin
moein.serpico14-Aug-10 21:39
moein.serpico14-Aug-10 21:39 
AnswerRe: Regular Expressions Pin
Luc Pattyn14-Aug-10 22:26
sitebuilderLuc Pattyn14-Aug-10 22:26 
AnswerRe: Regular Expressions Pin
PIEBALDconsult15-Aug-10 8:14
mvePIEBALDconsult15-Aug-10 8:14 
QuestionDirect access to the webCam of the machine on .net framework Pin
Yanshof14-Aug-10 20:32
Yanshof14-Aug-10 20:32 
AnswerRe: Direct access to the webCam of the machine on .net framework Pin
JF201514-Aug-10 23:08
JF201514-Aug-10 23:08 
QuestionGenerics question Pin
Pete Burkindine14-Aug-10 12:31
Pete Burkindine14-Aug-10 12:31 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 12:47
harold aptroot14-Aug-10 12:47 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 12:55
Pete Burkindine14-Aug-10 12:55 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 13:26
harold aptroot14-Aug-10 13:26 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 13:40
Pete Burkindine14-Aug-10 13:40 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 13:56
harold aptroot14-Aug-10 13:56 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 14:20
Pete Burkindine14-Aug-10 14:20 

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.