473,700 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control Drawing Issue

I have created a transparent control and I am using to to create drawing objects Inside the transparent objects I have created I am trying to using the draw shapes oval, rectangle etc. An example would be like in word are when you drag an oval onto the screen, the drawing resizes as the control does. The problem I am running into is actually drawing the rectangle. I am attempting to use this code here:

Rect = new Rectangle(this. Bounds.X - 10, (this.Bounds.Y -10), (this.Bounds.Wi dth - 10), (this.Bounds.He ight - 10))

I have placed this code in the Resize event. It does draw, however it seems to be reponsive to the bounds of it's container rather then the control itself. What I could like is if someone can help me figure out how to draw a rectangle close to the edges of the custom control and the drawing would resize itself as the control does. Please help!!! If anyone has any examples please email them mi*********@hot mail.com
Nov 15 '05 #1
0 1183

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

Similar topics

13
2077
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does overflow. All I know is that the program is either stopped due to an exception at the end of Main or has exited after the Stack Overflow exception. (Both cases are Debug builds running in the debugger.) After a lot of trial and error (mostly...
2
3973
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an array of object with some properties in common with the SelectedObject,and only properties in...
2
2237
by: David K. | last post by:
My question concerns C# Windows Forms user controls. I have created navigation user control. It gets the parent control's CurrencyManager to its bindable property. In the control, any change in the CurrencyManager position is displayed OK. But the problem is that the position of the parent CurrencyManager stays intact (doesn't change at all). In methods, a reference parameter solves such problem, but I don't know how to implement it with...
2
10040
by: Bill Struve | last post by:
Need: Auto-logon to a terminal server, start a program, and, when the user is quits the program, auto-logoff. Problem: When msrdp.ocx is added to the Toolbox, attempting to draw the control on the form gives the following "Microsoft Development Environment" message: "Compiler errors occured when generating a Windows Forms wrapper for ActiveX control 'AxMSTSCLib'. Source code saved in '...AxInterop.MSTSCLib.cs'. c:Documents and...
0
3261
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design time. If I type the code in the aspx manually it does get parsed correctly though. This is an example of the aspx code that gets parsed correctly. For some reason, if I changed update the Tab property of the control through the GUI at design...
4
9781
by: CP Developer | last post by:
I have a tab control in my application, and any time I mouse over or off of a tab, it flickers. It looks like it is redrawing it (albeit slowly) each time one of these mouse events are raised. I would like to eliminate this flicker, but I am not sure what might be causing it. I noticed the HotTrack attribute in the tab control properties, but turning it off did nothing. Infact, the tabs still visually changed with it off (added a little...
0
2011
by: gxl034000 | last post by:
Hi, I have been trying to use a .net Forms control in my webpage to open up an application(notepad) on the client. The control works fine when embedded in a windows form, but I keep getting a security exception when trying to run it from my webpage on my intranet. I have tried playing with the Code Access Security settings, but I can't get it to work. What do you think? Thanks,
1
1712
by: Sin Jeong-hun | last post by:
I have created a simple custom control, which displays a string data on it. It draws the string at its OnPaint(). When the string is changed I can call Invalidate() to redraw the string. Sort of simple. But I guess it might not be efficient. The instances of my custom controls are on a scrollable contrainer, so if it is not in a viewable area, calling Invalidate() may redraw things even if it's not necessary. Is Invalidate smart enough not...
4
5601
by: Anni V | last post by:
Hi, My page code behind code is attached ,I am a bit confused as the VS 2005 keeps giving me the error that chklistvyes & the other controls are not declared ,despite having the runat server in the html cade of the control, I keeps oin throwing this error can some one please help me out with this issue asap,please as I tried to figure it out many a time but in vain................. Partial Class CPro Inherits System.Web.UI.Page ...
0
8639
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9203
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
9058
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
8952
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
7794
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...
0
5895
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();...
1
3082
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
2375
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2018
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.