Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6010913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:11:03+00:00 2026-05-23T02:11:03+00:00

I want to draw in a panel with this method: protected override void InitOutput(object

  • 0

I want to draw in a panel with this method:

protected override void InitOutput(object output)
        {
            if (output is Control)
            {
                Control c = (Control)output;
                g.FillRectangle(hb, 7, 10, 30 - 19, 5);
                ...
            }

With a text I can do this:

protected override void InitOutput(object output)
        {
            if (output is Control)
            {
                Control c = (Control)output;
                lbl.Name = "lbl";
                lbl.Size = new System.Drawing.Size(10, 10);
                lbl.TabIndex = 5;
                lbl.Text = "test";

                panel.Location = new System.Drawing.Point(1, 1);
                panel.Name = "panelSys";
                panel.Size = new System.Drawing.Size(20, 20);
                panel.TabIndex = 5;
                panel.Controls.Add(lbl);
                c.Controls.Add(panelSys);
            }

Hope you can help me
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:11:04+00:00Added an answer on May 23, 2026 at 2:11 am

    I am not sure why do you need InitOtuput function but if you want to draw from it you could do it like this:

    private void InitOutput(object output)
    {
        if (output is Control)
        {
            Control c = (Control)output;
            c.Paint += new System.Windows.Forms.PaintEventHandler(c_Paint);
            // Invalidate needed to rise paint event
            c.Invalidate();
        }
    }
    private void c_Paint(object sender, PaintEventArgs e)
    {
        SolidBrush hb =  new SolidBrush(Color.Red);
        e.Graphics.FillRectangle(hb, 7, 10, 30 - 19, 5);
        e.Graphics.DrawString("test", DefaultFont, hb, new PointF(50, 50));
    }
    

    Additionaly you don’t need to use label to draw text u can draw it using Graphics.DrawSting

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to draw a text with 32 bit transparency on a graphics object.
I want to draw some lines and rectangles on a panel. Sometimes it does
I'm implementing an application which want to draw lines in the panel. But the
I want to draw this in my view to draw this line, I have
I want to draw an array of X and Y integers to a panel
So this is the panel for my RocketShip and I want to add my
I want to be able to use a Panel or similar to draw graphics
I want draw a line between to specify point in java 3d. how can
I want to draw a line in a JPanel. This is my GUI and
I want to draw DirectX content so that it appears to be floating over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.