Click here to Skip to main content
15,212,102 members
   

C#

 
QuestionHashTable elements not found in the same order as they are added Pin
mmdullah10-Jun-09 19:06
Membermmdullah10-Jun-09 19:06 
AnswerRe: HashTable elements not found in the same order as they are added [modified] Pin
Seikilos10-Jun-09 19:41
MemberSeikilos10-Jun-09 19:41 
QuestionHow can i get the VISIBLE bounds of a control. [modified] Pin
hwswin10-Jun-09 18:15
Memberhwswin10-Jun-09 18:15 
AnswerRe: How can i get the VISIBLE bounds of a control. Pin
Rob Philpott10-Jun-09 22:46
MemberRob Philpott10-Jun-09 22:46 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
hwswin11-Jun-09 15:21
Memberhwswin11-Jun-09 15:21 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
hwswin11-Jun-09 17:35
Memberhwswin11-Jun-09 17:35 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
Rob Philpott12-Jun-09 1:59
MemberRob Philpott12-Jun-09 1:59 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
hwswin12-Jun-09 5:13
Memberhwswin12-Jun-09 5:13 
Thanks again!
Rob Philpott wrote:
The right and bottom line are probably not appearing because they're outside the clip rectangle


I use the Inflate(-2, -2) to make sure the Rectangle was inside the clip rectangle,but they're still not appearing.

follow is the test code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace draw
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.panel1 = new System.Windows.Forms.Panel();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.groupBox1);
            this.panel1.Location = new System.Drawing.Point(192, 141);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(200, 100);
            this.panel1.TabIndex = 0;
            // 
            // groupBox1
            // 
            this.groupBox1.Location = new System.Drawing.Point(91, 43);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(200, 100);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "groupBox1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(674, 358);
            this.Controls.Add(this.panel1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.GroupBox groupBox1;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Control ctrl = groupBox1;
            Control ctrlP;

            ctrlP = ctrl.Parent;
            Rectangle r = ctrl.Bounds;
            Rectangle rP = new Rectangle(0, 0, ctrlP.Width, ctrlP.Height);
            r.Intersect(rP);
            r.Inflate(-2, -2);

            Graphics g = ctrlP.CreateGraphics();
            Pen p = new Pen(Color.Red);
            p.Width = 1.5f;
            g.DrawRectangle(p, r);
            g.Dispose();
        }
    }
}

GeneralRe: How can i get the VISIBLE bounds of a control. Pin
hwswin12-Jun-09 5:39
Memberhwswin12-Jun-09 5:39 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
Rob Philpott12-Jun-09 5:40
MemberRob Philpott12-Jun-09 5:40 
GeneralRe: How can i get the VISIBLE bounds of a control. Pin
hwswin12-Jun-09 5:47
Memberhwswin12-Jun-09 5:47 
Questionwhat is the best and more professional GUI designing? Pin
cppwxwidgetsss10-Jun-09 17:57
Membercppwxwidgetsss10-Jun-09 17:57 
AnswerRe: what is the best and more professional GUI designing? Pin
N a v a n e e t h10-Jun-09 18:21
MemberN a v a n e e t h10-Jun-09 18:21 
QuestionI want to do a control like vs2005 doc outline tool Pin
hwswin10-Jun-09 17:40
Memberhwswin10-Jun-09 17:40 
AnswerRe: I want to do a control like vs2005 doc outline tool Pin
Christian Graus10-Jun-09 17:52
mveChristian Graus10-Jun-09 17:52 
GeneralRe: I want to do a control like vs2005 doc outline tool Pin
hwswin10-Jun-09 18:09
Memberhwswin10-Jun-09 18:09 
GeneralRe: I want to do a control like vs2005 doc outline tool Pin
S. Senthil Kumar10-Jun-09 23:59
MemberS. Senthil Kumar10-Jun-09 23:59 
GeneralRe: I want to do a control like vs2005 doc outline tool Pin
hwswin11-Jun-09 15:30
Memberhwswin11-Jun-09 15:30 
GeneralRe: I want to do a control like vs2005 doc outline tool Pin
S. Senthil Kumar11-Jun-09 21:06
MemberS. Senthil Kumar11-Jun-09 21:06 
QuestionCommand Scripts Pin
bigjoe11a10-Jun-09 17:06
Memberbigjoe11a10-Jun-09 17:06 
QuestionUm, Opening link in new tab - not new window? [modified] Pin
Baeltazor10-Jun-09 15:15
MemberBaeltazor10-Jun-09 15:15 
Questionwriting a development environment Pin
JimLaVine10-Jun-09 14:45
MemberJimLaVine10-Jun-09 14:45 
AnswerRe: writing a development environment Pin
Christian Graus10-Jun-09 14:48
mveChristian Graus10-Jun-09 14:48 
AnswerRe: writing a development environment Pin
Luc Pattyn10-Jun-09 14:49
sitebuilderLuc Pattyn10-Jun-09 14:49 
GeneralRe: writing a development environment Pin
JimLaVine10-Jun-09 15:03
MemberJimLaVine10-Jun-09 15:03 

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.