473,799 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use ControlPaint to draw Grab Handles and a Grid

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

<code>
Me.SetStyle(Con trolStyles.User Paint, True)
Me.UpdateStyles ()

ControlPaint.Dr awGrid(Drawing. Graphics.FromHw nd(Me.Handle), New
Rectangle(Me.Lo cation, Me.Size), New Size(10, 10), Color.AliceBlue )
</code>

The MSDN implies that this is all I need do, but it doesn't work.

Can anyone suggest where I am going wrong?

TIA

Charles
Nov 20 '05 #1
0 1482

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

Similar topics

21
3078
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do it using DirectX. I downloaded already the DSK etc, but I can't find how I need to draw an image on a given position. I don't need stuff to write advanced 3D-games, just painting that image. Can anybody help me with this? I'm already looking for...
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
1305
by: Alejandro K. | last post by:
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...
1
3781
by: Jeff Waskiewicz | last post by:
Hello All, I'm trying to solve a nagging problem. The goal is to draw a rectangle over the top of all the other controls on a form. Specifically, over a ChartFX control. The user would draw the rectangle using the right mouse button to represent the area of the chart they want to zoom on. I haev been able to draw the rectangle on a blank form but I cannot get it to draw on top of other controls. I have pasted in the code i am using ....
0
2884
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is below: chartGenerator.vb class: Imports System.Drawing.Imaging Public Class chartGenerator Private myImage As Bitmap
1
3536
by: Tom | last post by:
Hey, I have tried drawing a grid onto my control using the following: Private Sub VGUI_Grid(...) Handles MyBase.Paint Dim new_bitmap As Bitmap ' Make a new bitmap that fits the PictureBox. new_bitmap = New Bitmap(Me.Width, Me.Height)
0
1386
by: kam45 | last post by:
I did one program that draws a line with two squares at the ends and I can just click and extend each ends. It works ok but I need to move the whole line. Would anyone knows how? Private Const gs As Integer = 34 Private Const hw As Integer = 6 Private Const hhw As Integer = hw \ 2 Private bf As Bitmap Private drag As Integer = -1 Private pts() As Point Private Sub Form1_Load(ByVal sender As System.Object,...
8
7692
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
10259
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
10238
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
9077
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
7570
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
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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...
1
4145
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
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.