Click here to Skip to main content
15,915,864 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with diagnosing a service failing Pin
turbosupramk328-Feb-11 9:12
turbosupramk328-Feb-11 9:12 
GeneralRe: Help with diagnosing a service failing Pin
RobCroll28-Feb-11 11:33
RobCroll28-Feb-11 11:33 
GeneralRe: Help with diagnosing a service failing Pin
RobCroll28-Feb-11 11:29
RobCroll28-Feb-11 11:29 
GeneralRe: Help with diagnosing a service failing Pin
turbosupramk328-Feb-11 15:12
turbosupramk328-Feb-11 15:12 
Questiondraw Pin
om_metab25-Feb-11 10:56
om_metab25-Feb-11 10:56 
Questiondraw Pin
om_metab25-Feb-11 10:42
om_metab25-Feb-11 10:42 
AnswerRe: draw Pin
fjdiewornncalwe25-Feb-11 10:55
professionalfjdiewornncalwe25-Feb-11 10:55 
AnswerRe: draw Pin
OriginalGriff25-Feb-11 21:05
mveOriginalGriff25-Feb-11 21:05 
Please do not post the same question more than once: delete your other version before it gets a reply!

I'm not going to answer your questions directly: I don't think you are quite ready to go that far, from your questions so far. Instead, some basics which should help you to do some of it, and will set you on the right path.

At present, you are using CreateGraphics to get the Graphics object for drawing, probably in a timer event, or a loop. Am I right?

Don't do that. Instead, handle the Panel.Paint event. (Click on the panel in the designer, select events in the Properties pane - the lightning bolt button - and double click the Paint event).
In the handler routine, you have two parameters:
void panel_Paint(object sender, PaintEventArgs e)
    {
    }

The sender is the panel that need to be painted, and e is the information you need to know about how to paint it.
Convert the sender to a Panel, and get the Graphics object from e:
void panel_Paint(object sender, PaintEventArgs e)
    {
    Panel myPanel = sender as Panel;
    if (myPanel != null)
        {
        Graphics g = e.Graphics;

        }
    }
Don't worry about the conversion code: it just means you can use the same method for more than one Panel if you need to.

You can now use g to draw on the Panel, and it will not disappear.

So, that solves question 3!

How do you draw text? Simple:
g.DrawString("Hello", new Font("Arial",16), Brushes.Black, new Point(0,0));


How do you make the Panel draw when you want? Simple:
myPanel.Invalidate();
Call that when you have changed the information that you want to draw - the position of the text, for example. (Don't call it in the Paint handler, that won't work!)

So that solves question 2!

Question 1 is probably way too complex at the moment - which makes me think you have asked the wrong question! If it is still a problem, try asking in more detail about what you are trying to do.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

QuestionMouse cursor modification by getting data from web browser object Pin
HalliHaida25-Feb-11 1:38
HalliHaida25-Feb-11 1:38 
AnswerRe: Mouse cursor modification by getting data from web browser object Pin
Piccadilly Yum Yum25-Feb-11 3:10
Piccadilly Yum Yum25-Feb-11 3:10 
GeneralRe: Mouse cursor modification by getting data from web browser object Pin
HalliHaida27-Feb-11 17:16
HalliHaida27-Feb-11 17:16 
AnswerRe: Mouse cursor modification by getting data from web browser object Pin
Espen Harlinn25-Feb-11 4:13
professionalEspen Harlinn25-Feb-11 4:13 
Questioncreate an email application for own website Pin
gskumbhar24-Feb-11 22:49
gskumbhar24-Feb-11 22:49 
AnswerRe: create an email application for own website Pin
OriginalGriff24-Feb-11 22:58
mveOriginalGriff24-Feb-11 22:58 
GeneralRe: create an email application for own website Pin
Pravin Patil, Mumbai24-Feb-11 23:57
Pravin Patil, Mumbai24-Feb-11 23:57 
AnswerRe: create an email application for own website Pin
Pete O'Hanlon24-Feb-11 23:50
mvePete O'Hanlon24-Feb-11 23:50 
AnswerRe: create an email application for own website Pin
Dalek Dave25-Feb-11 0:00
professionalDalek Dave25-Feb-11 0:00 
GeneralRe: create an email application for own website Pin
Pravin Patil, Mumbai25-Feb-11 3:15
Pravin Patil, Mumbai25-Feb-11 3:15 
GeneralRe: create an email application for own website Pin
Dalek Dave25-Feb-11 5:58
professionalDalek Dave25-Feb-11 5:58 
GeneralRe: create an email application for own website Pin
Ali Al Omairi(Abu AlHassan)25-Feb-11 8:53
professionalAli Al Omairi(Abu AlHassan)25-Feb-11 8:53 
AnswerRe: create an email application for own website Pin
Abhinav S25-Feb-11 3:21
Abhinav S25-Feb-11 3:21 
AnswerRe: create an email application for own website Pin
RaviRanjanKr28-Feb-11 2:34
professionalRaviRanjanKr28-Feb-11 2:34 
QuestionObject reference not set to an instance of an object. Pin
Pierre besquent24-Feb-11 21:55
Pierre besquent24-Feb-11 21:55 
AnswerRe: Object reference not set to an instance of an object. Pin
OriginalGriff24-Feb-11 22:32
mveOriginalGriff24-Feb-11 22:32 
GeneralRe: Object reference not set to an instance of an object. Pin
Pierre besquent24-Feb-11 22:39
Pierre besquent24-Feb-11 22:39 

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.