473,811 Members | 3,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ControlPaint.Dr awborder

First of all i know that this might be for the Drawing newsgroup but i
posted there and got no answers so.... let see if somebody here can help
me.
Hi , i got some problems using Paint event... the thing is that i got my
form divided in 2 using a splitter. the splitter divides 2 Panels that
are Docked to Fill
inside each panel i want to draw a small grey rectangle acting like
borders of the panel,it is working but if i move the Splitter sometimes
it does not refresh , or keeps drawing multiple lines without deleting
the previous ones.
Inside my Paint Event of my Panels i got the following code:

Private Sub PanMain_Paint(B yVal sender As Object, ByVal e As
System.Windows. Forms.PaintEven tArgs) Handles PanMain.Paint
ControlPaint.Dr awBorder(e.Grap hics, New Rectangle(1, 1,
PanMain.Width - 1, PanMain.Height - 1), Color.Gray,
ButtonBorderSty le.Solid)
End Sub

Private Sub PanScreen_Paint (ByVal sender As Object, ByVal e As
System.Windows. Forms.PaintEven tArgs) Handles PanScreen.Paint
e.Graphics.Flus h()
ControlPaint.Dr awBorder(e.Grap hics, New Rectangle(1, 1,
PanScreen.Width - 1, PanScreen.Heigh t - 1), Color.Gray,
ButtonBorderSty le.Solid)
End Sub

Thanks in advance for any kind of help.
Alex.

Nov 20 '05 #1
0 1306

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
12348
by: Stuart Norris | last post by:
Dear Readers, I am attempting to draw box around some text using unicode on multiline label. The label is forty characters wide and 12 lines deep. I have been trying to draw a box around text (centered in the label) on this label. My font on this label is Courier new - hence fixed width character cells.
1
6663
by: Tomasz Kulig | last post by:
Hello... I've some annoying problem when I use DrawGrid method. It seems that it ignores nOffsetX and nOffsetY (refer to example code). Bounding rectangle can be moved, but points of grid are being drawn always in the same positions of screen. Do you have some idea how to fix it? I want to see dots exactly drawn from specified point.
4
1945
by: Joe Kasta | last post by:
Here's a tricky question..:) I have a a function in a webform that will draw a checkbox in a given area (note, this is an override of a PaintForeground function, not a drop / drag of a checkbox from the toolbar). System.Windows.Forms.ControlPaint.DrawCheckBox(e.Graphics, tempRectangle, Windows.Forms.ButtonState.Checked) It's draw in a cell within a grid. I use an AddHandler function to call a function (Call it Function X) when the...
0
1483
by: Charles Law | last post by:
The ControlPaint class looks like the ideal way to draw grab handles, a grid, and other designer-like stuff in a windows form, but I can't make it work. I realise I need to use SetStyle to set the UserPaint bit, but the method is protected on a textbox, for example, so I can't call it. If I call it for the form, and use DrawGrid, I get nothing. For example, in the form Load event
7
3358
by: Maileen | last post by:
Hi, I asked few days ago about a flat button control under VB.NET but answer didn't satisfy me. I know that a such button existed under VB6 so it should exist under VB.NET also. Where can i find this Flat button control ? COM, ActiveX ?
16
1675
by: Geoff Jones | last post by:
Hiya Could anybody direct me to some examples of code to do the following: Display a bitmap on a form which can then be moved about i.e. dragged, using the left down button of the mouse. Thanks in advance Geoff
8
12786
by: pigeonrandle | last post by:
Hi, Please pity me, i am on a dial-up connection for the first time in 5 years :( ! Does anyone know how the resulting Graphics objects differ ...? What i really mean is can someone explain it to me please? A) protected static extern IntPtr GetWindowDC (IntPtr hWnd );
2
5523
by: =?Utf-8?B?SGFucyAtIERpYUdyYXBoSVQgLQ==?= | last post by:
Hi! I have a windowsform with an imagebox inside a groupbox. The imagebox shows a image of a man with joints (for medical purose - shoulder, ancle, wrist etc.). The user is able to mark the jonts by clicking on the spesific joint. I solved this by using checkbox (with button-appearance) upon each joint. I know wish to further develop my windows-application. How can I make my button-appearance checkboxs to be transparent? I wish to...
8
7696
by: Rainer Queck | last post by:
Hello NG, I had/have a bad flicker Problem with my Application. On starting some applications, while my app was running, the whole Display started to flicker. Even the desktop Icons! Looking for help on this issue, I ran over a anser Linda Liu at : http://groups.google.de/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/39e9f7d0b96b048f?hl=de where I found the following (quick and dirty )solution to the flicker
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.