panel

Clearing the graphics of a transparent panel C#

谁说胖子不能爱 提交于 2019-12-02 07:46:06
I have a WebBrowser control with a transparent panel over the top of it, what I am trying to do is draw a rectangle on the transparent panel around the element in the page that the mouse is hovering over. So far I have everything working except the panel is not being cleared before drawing the next rectangle so I end up with rectangles everywhere. heres the code Im using. paneGraphics = drawingPane.CreateGraphics(); Rectangle inspectorRectangle; inspectorRectangle = controller.inspectElement(); paneGraphics.DrawRectangle(new Pen(Color.Blue, 1), inspectorRectangle); drawingPane.Invalidate(); I

C# panel move with collision

…衆ロ難τιáo~ 提交于 2019-12-02 07:20:25
I am new to C# and Winforms and try to make a moving panel. It should move right until the end of my window and then back left. It should bounce from side to side. But the only thing happened after hours of trying is that it moves left and stops. Using this form tools: Timer = tmrMoveBox (interval: 50) Panel = pnlBox Label = lblXY (for showing the X and Y coordinates in the form) Here are my first best try: private void tmrMoveBox(object sender, EventArgs e) { if (pnlBox.Location.X <= 316) { for (int i = 0; i <= 316; i++) { pnlBox.Location = new Point( pnlBox.Location.X + 2, pnlBox.Location.Y)

PaintEvent not overpainting

我的未来我决定 提交于 2019-12-02 04:01:42
问题 I have a Windows Forms application in C# with drawing panel and a button - for drawing a line. When you click the button, you can draw a line for 2 random points. Pen p = new Pen(Color.Black, 5); //point for start Point ps = new Point(); //point for end Point pe = new Point(); private void drawPanel_MouseDown(object sender, MouseEventArgs e) { ps.X = e.X; ps.Y = e.Y; pe = ps; } private void drawPanel_MouseMove(object sender, MouseEventArgs e) { // when button is clicked for drawing draw =

extjs 3.3: floating panel

谁说胖子不能爱 提交于 2019-12-02 02:56:59
问题 I am trying to create a floating panel over other pre-created panels, I tried following simple codes, but failed: var testPanel = new Ext.Panel({ id: 'testP', width: 50, height: 100, floating: true, title:'Test' }); testPanel.show(); what else I need to think about? thanks! 回答1: Following needs to be taken care of when using the floating config: 1) Fixed width - which you've done 2) The position must be set explicitly after render (e.g., myPanel.setPosition(100,100); ). You can also set the

How to make p:dashboard components draggable without panel header being set

梦想的初衷 提交于 2019-12-02 01:53:56
问题 As a follow up to this question. It appears the components in a p:dashboard are only draggable if their parent panel has a header set (which contains the title). How do I make it so the panels can be dragged even if the header isn't set? So the whole panel will be the handle to drag it around, not just the header. XHTML <!DOCTYPE html> <html xmlns="http://www.w3c.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Example</title> </h

How to make p:dashboard components draggable without panel header being set

夙愿已清 提交于 2019-12-02 01:25:10
As a follow up to this question . It appears the components in a p:dashboard are only draggable if their parent panel has a header set (which contains the title). How do I make it so the panels can be dragged even if the header isn't set? So the whole panel will be the handle to drag it around, not just the header. XHTML <!DOCTYPE html> <html xmlns="http://www.w3c.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Example</title> </h:head> <h:body> <h:form id="splitButtonForm"> <p:splitButton value="Action" icon="ui-icon-circle-triangle

extjs 3.3: floating panel

早过忘川 提交于 2019-12-01 22:49:07
I am trying to create a floating panel over other pre-created panels, I tried following simple codes, but failed: var testPanel = new Ext.Panel({ id: 'testP', width: 50, height: 100, floating: true, title:'Test' }); testPanel.show(); what else I need to think about? thanks! Following needs to be taken care of when using the floating config: 1) Fixed width - which you've done 2) The position must be set explicitly after render (e.g., myPanel.setPosition(100,100); ). You can also set the underlying Ext.Layer config option instead of just setting floating : true . You can do that in the following

How can I draw on Panel so it does not blink?

拥有回忆 提交于 2019-12-01 21:15:14
This is my code. When I move cursor over Form it works, circle is moving but it is blinking. How can I fix this? public partial class Preprocesor : Form { int x, y; Graphics g; public Preprocesor() { InitializeComponent(); } private void Preprocesor_Load(object sender, EventArgs e) { g = pnlMesh.CreateGraphics(); } private void pnlMesh_Paint(object sender, PaintEventArgs e) { g.Clear(Color.White); g.FillEllipse(Brushes.Black, x, y, 10, 10); } private void pnlMesh_MouseMove(object sender, MouseEventArgs e) { x = e.X; y = e.Y; pnlMesh.Invalidate(); } } You need to draw on a double-buffered

Panel Drawing zoom in C#

青春壹個敷衍的年華 提交于 2019-12-01 21:13:47
I have a Form that contain a panel, and in this panel I draw shapes, like rectangles and circles, I need to zoom into this shapes, I saw couple options but most of them using PictureBox. Should I use Bitmap creating the panel area as a bitmap and change the zooming factor ?? would this help me also further if I want to have Panning and not draw images not into the fit in the panel size. Here is a snapshot of my code private void panel1_Paint(object sender, PaintEventArgs e) { Graphics g = panel1.CreateGraphics(); SolidBrush myBrush = new SolidBrush(Color.Black); Pen p = new Pen(Color.Black);

VB / C#: Resizing two controls equally

流过昼夜 提交于 2019-12-01 19:14:30
I have made a window in which I will be having two groups/panels and some buttons in between them. I want to code the resizing behavior in a way that when the window expands, the two panels increase their widths while keeping the distance between them constant. Please see this mockup: As you see above, I want the 'Local' and 'Server' Panels to resize while keeping the distance in between them same. If I use anchors (Top+Left+Right+Bottom), the left panel will overlap the right one and the right's width one will go out of the window. I want them to share the increased width of the window