i made 3 forms . 1.. frmMain(it is the mdiContainer) (form)
2........frmEditable (form)
3....... frmTools (form)
now
i just want that when i click on the rectangle button from frmTools form a rectangle must should be drawn on frmEditable form.
6 1587
Hi there,
well if you create an event in the form with the controls which passes a value of some sort (an enumeration based on the selected shape) and subscibe to that event in the form where you want to draw the shape, you can have a switch to based on the eventargs.
then its simply calling the right procedure to draw the right shape.
Good luck
dear knew that but how it is..
where can i call it. draw is a function and i have to take result in frmEditable (form) .can you say that i should call it on some controls?
if yes then how?
there is a huge confusion about this in my mind ..
kindly explain me with some code...
thx
first create the event: - event eventhandler<ToolTypeArgs> toolChanged;
when you raise the event: - if(this.toolChanged != null)
-
{
-
this.toolChanged(this, new ToolTypeArgs(ToolTypes.Rectangle));
-
}
thats how to create an event with custom arguments, you need to first create the ToolTypeArgs class, it must inherit from EventArgs and I used a ToolTypes enumeration which you will need to create.
try this, subscribe to the event in the form where you will draw, use a switch in the eventHandler to call the correct draw procedure (or even better create overridden draw functions). Try this and if you still have problems, post the code with which you are struggling.
i m sending this..
i want to draw it in frmEditable(form).
frmTools(form) contain tools from which i click lblRect (its a label)
,a rectangle should be drawn on frmEditable('s form).
ok, i gave a suggestion to use a custom event. I dont see you trying that anywhere, you dont use code tags and post REALLY quickly after i post. I take the time to think about your problem, please take the time to think about my post and try to use my advice or post 'no thank you' and i will stop. I'm not gonna write this project for you.
Best of luck to you
dear i m not asking you to write my whole project..
dear my project is not a short project.
its just starting...
ok..
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard |
last post by:
I have a requirement to put a GDI style circle or rectangle border around
the selected row of a datagrid/ It will overlap into the row above and below
the selected row. Doing this in a the OnPaint...
|
by: Praveen |
last post by:
Hello,
I have a web page which will display the map of a
city/place. I have a toolbar which contains 'zoom in'
and 'zoom out' buttons. When the user clicks on zoom
in/zoom out button, he should...
|
by: Colin McGuire |
last post by:
Hi there. I have written a small procedure to draw various shapes on
things. A bit of it is shown below.
Private Sub drawShape(ByVal shapeType As Integer, ByRef g As Graphics)
Select Case...
|
by: Rob Richardson |
last post by:
Greetings!
I am creating a form that will contain information that will eventually be
on a label. The label has a 2-column table with lines separating the cells.
I want my form to resemble the...
|
by: Tom |
last post by:
Hi
Hi i am trying to draw on top of a button on a standard toolbar. All i
want to do is draw a small rectangle on the button to represent the
selected color.
I have tried the folowing code in...
|
by: Mark Ingram |
last post by:
Hi, how can i draw a rounded rectange, with a border within a specified
area?
i.e. if i have a Rectangle with width and height of 100, how can i draw
a rectange with 2 pixel border inside of the...
|
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...
|
by: Phil |
last post by:
I would like to draw some text which will be in front of any other controls,
but without obscuring them completely. If I use DrawString in the form's
Paint handler the text is always behind, not in...
|
by: kummu4help |
last post by:
hi,
i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates.
i have the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |