Click here to Skip to main content
16,018,442 members
Home / Discussions / C#
   

C#

 
AnswerRe: slowing down the process Pin
Guffa25-Nov-06 13:22
Guffa25-Nov-06 13:22 
AnswerRe: slowing down the process Pin
Martin2326-Nov-06 5:13
Martin2326-Nov-06 5:13 
GeneralRe: slowing down the process Pin
Argus226-Nov-06 13:34
Argus226-Nov-06 13:34 
Questionusing windows service to copy file through network(LAN) Pin
ctlqt1225-Nov-06 11:42
ctlqt1225-Nov-06 11:42 
AnswerRe: using windows service to copy file through network(LAN) Pin
KevinMac25-Nov-06 19:07
KevinMac25-Nov-06 19:07 
GeneralRe: using windows service to copy file through network(LAN) [modified] Pin
ctlqt1226-Nov-06 3:31
ctlqt1226-Nov-06 3:31 
GeneralRe: using windows service to copy file through network(LAN) Pin
Weckmann27-Nov-06 4:11
Weckmann27-Nov-06 4:11 
Questionctrl.BackgroundImage vs. clientRectangle in paint event... Pin
new_phoenix25-Nov-06 10:35
new_phoenix25-Nov-06 10:35 
Is it possible to utilize a clientRectangle and to assign the background image to that client rectangle outside of a paint event handler? When there is a control and a background image is assigned like this:

Control ctrl = ((Control)sender);
ctrl.BackgroundImage = (path to an image file);


then the control either increases or decreases in size, then the background image is distorted or stretched in the process. However, if a control has a clientRectangle positioned on it, the clientRectangle would not be distorted or stretched accordingly. The code would be like so:

public Rectangle clientRectangle;
...
int intWidth = 78, intHeight = 109;
clientRectangle = new Rectangle(0, 0, intWidth, intHeight);


The question is, is it possible to assign a background image to the clientRectangle from the Form Load event handler instead of from a paint event handler.

It is my understanding that the PaintEventArgs from the paint event handler is required to assign the image to the clientRectangle. Is there another way that the image file could be assigned to the client rectangle, although not from the paint event handler but instead from the Form Load event handler? The code would be like so.

p.Graphics.DrawImage(imgFile, clientRectangle);



Would appreciate some input as to how to approach this issue so that the background image is not assigned to the control but instead to the clientRectangle.

Confused | :confused: Confused | :confused: Confused | :confused:



-- modified at 17:15 Saturday 25th November, 2006
Questionmulti threading Pin
sorayya_sk25-Nov-06 9:56
sorayya_sk25-Nov-06 9:56 
QuestionSelected TreeView Item Pin
Alan Martinis25-Nov-06 9:24
Alan Martinis25-Nov-06 9:24 
AnswerRe: Selected TreeView Item Pin
Rob Graham25-Nov-06 10:47
Rob Graham25-Nov-06 10:47 
AnswerRe: Selected TreeView Item Pin
beatles169225-Nov-06 22:53
beatles169225-Nov-06 22:53 
QuestionSelected TreeView Item [modified] Pin
Alan Martinis25-Nov-06 9:22
Alan Martinis25-Nov-06 9:22 
AnswerRe: Selected TreeView Item Pin
Bassam Saoud25-Nov-06 22:12
Bassam Saoud25-Nov-06 22:12 
GeneralRe: Selected TreeView Item Pin
Alan Martinis26-Nov-06 12:48
Alan Martinis26-Nov-06 12:48 
GeneralRe: Selected TreeView Item Pin
Scott Dorman27-Nov-06 4:51
professionalScott Dorman27-Nov-06 4:51 
AnswerRe: Selected TreeView Item Pin
darkelv26-Nov-06 15:57
darkelv26-Nov-06 15:57 
QuestionAdding new items to TreeView Pin
Mark F.25-Nov-06 8:53
Mark F.25-Nov-06 8:53 
AnswerRe: Adding new items to TreeView Pin
Not Active25-Nov-06 10:28
mentorNot Active25-Nov-06 10:28 
GeneralRe: Adding new items to TreeView Pin
Mark F.25-Nov-06 11:22
Mark F.25-Nov-06 11:22 
GeneralRe: Adding new items to TreeView Pin
Not Active25-Nov-06 14:11
mentorNot Active25-Nov-06 14:11 
QuestioncrystalReport Pin
aPerfectCircle25-Nov-06 8:18
aPerfectCircle25-Nov-06 8:18 
Questionbubble and quick method Pin
sapnju_fejinja25-Nov-06 7:33
sapnju_fejinja25-Nov-06 7:33 
QuestionRe: bubble and quick method Pin
CPallini25-Nov-06 8:50
mveCPallini25-Nov-06 8:50 
AnswerRe: bubble and quick method Pin
sapnju_fejinja25-Nov-06 9:47
sapnju_fejinja25-Nov-06 9:47 

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.