|
I had a look at the Drawarc method but i can't understand a thing. I need a draw arc method that requiers : the coordenates for the center of the circle, the radius and the angle it sweeps!
rzvme
|
|
|
|
|
It's not that hard.
Instead of a center point and radius the method takes a rectangle which specifies the bounds of the arc. Imagine it the other way round. You have an arc and put a rectangle over it so that the arc touches all sides of the rectangle.
It's simple mathematics to calculate the dimension and position of the rectangle from a center point and radius.
Furthermore the two angle parameters shouldn't be that hard to understand. If the textual description isn't sufficient, simply experiment a bit with them.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi, I am using ReportViewer reports for my reporting.
I want to use the Image control(instead of Chart control) report item to draw the graphs. I need a drawing surface to draw the graph using methods from Graphics Class and show it in the Image control when I view the report . Thanking you in anticipation.
Ramith Sivanarain
|
|
|
|
|
Hi,
Can any one help me in changing the attribute value of a child attribute when the parent attribute value is changed .
eg
parent property
[readonly(true)]
parent {get{return child;}set{child =value;}}
child class
class child
{
a {get{return 1;}set{1 =value;}}
}
for this eg if i channge read only attribute for parent it should affect child also,
Thank you
regards
Praveen
|
|
|
|
|
Create an event and fire it when parent properties get changes.in that event pass the object of parent classs.Now you can set you desired child Properties
|
|
|
|
|
hi,
I guess you understood wrongly what i meant was
if i change read only attribute for parent it should affect child also,
eg
parent property
[readonly(true)]
parent {get{return child;}set{child =value;}}
child class
class child
{
a {get{return 1;}set{1 =value;}}
}
Thank you
regards
Praveen
|
|
|
|
|
praveenqwe wrote: if i change read only attribute for parent it should affect child also
Hi Praveen,
What sam# suggest, is right. See this[^] and this too[^]. Hope these articles may help in giving you a solution.
By the way, what is the meaning of this:
praveenqwe wrote: a {get{return 1;}set{1 =value;}}
also, my c# compiler gives me an error on the statement 1 = value; , which is The left-hand side of an assignment must be a variable, ...
Regards
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi ,
I want to open the foder. That is on a button click
I want to show folder open in explorer. How to do that?
Rahul Kulkarni.
|
|
|
|
|
Maybe this article will help you ?
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Thanks For your response.
I want to show the folder content. Take an example,
"path = c:\test\" and now normally if we want to see content of this folder
We have to go through click on My Computer then c: and finally test.
But i want to open test through programming in C#.Net. How to do that?
Rahul Kulkarni
|
|
|
|
|
Try this code:
<br />
System.Diagnostics.Process.Start("explorer.exe", "c:\\Test");<br />
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
|
I have a datatable as the datasource for a datagridview.
One of the columns displays IDs for another datatable (this relationship is specified in the dataset).
Is there any way to specify that this column should be a comboboxcolumn, bound to the related table, rather than just a textboxcolumn?
|
|
|
|
|
Yes there is.
Use the DataGridView designer to modify the properties for the column.
Also try using a BindingSource (bound to your DataSet) as the data source for the DataGridView. That way you can bind the DataGridView rows to one table and the ComboBoxColumn drop-down to another table easily through the designer.
- Xint0
|
|
|
|
|
The table is dynamically generated, so not really accessible to the designer.
I'm not sure how I'd use the BindingSource alternative. Is there a good tutorial or some such on how I might do this?
Thanks.
-- modified at 23:57 Thursday 2nd November, 2006
Maybe I should be more specific.
I have a table of employees, and a table of shifts available to work.
There is a table which links the 2 via foreign keys to represent a many-to-many relationship.
For easier editing, I create a custom datatable at runtime, where each column represents one of the shifts, and there is one column for specifying the employee's ID.
I would like the employee ID column to be a combobox column with the combobox values taken from the employee table (ValueMember = id, DisplayMember = name).
Currently, after creating the custom table, I assign it as the datasource of a datagridview, but the default situation is that the column is simply displayed as a textboxcolumn.
Is there a way (outside of the designer), to easily do this (I'm still looking into the bindingsource option)?
Any help would be appreciated, this has really got me stumped.
|
|
|
|
|
I finally figured it out.
I create the comboboxcolumn before binding to the datatable, bind the column to the employee table, and set its DataPropertyName to the name of the custom table's employee ID column name, and the column from the datatable gets pushed into it.
|
|
|
|
|
Hi everyone,
I am at wits end. I think I've read every article on CP and searched for them on the web and I just can't figure this out. I have built an application that has a lot of group boxes and controls within those group boxes on the form. I designed it with a screen resolution of 1280x1024 in mind because that is what all of us use. The controls fit just right when maximized. Now, I get this one user who is still using 1024x768 and I'm hosed!
There are some group boxes and some comboboxes/textboxes that I can resize and make smaller (when they entered data, it would scroll out of the box, but no big deal).
So now I have to re do this application to make it so that it resizes certain controls in certain group boxes when the form size is changed. (ie, they resize the control, I need one of the group boxes to get bigger, and a control or two within that groupbox to get bigger too)
I have tried playing with DOCK and ANCHOR on end. I can't get it to work right. Setting an anchor property of TOP,LEFT,RIGHT,BOTTOM resizes the group box that I want, but the problem is that when it is resized too much, that group box runs into the next group box below it. I just cannot figure out how to use panels, flowlayoutpanels, dock and anchor properties to only resize some controls but do not interfere with other controls (there are buttons / textboxes next to each other, and above and below each other, each time I've tried one of the buttons will resize itself and overrun the next) I can't get them all to just work nicely with one another!
I went to the store and bought two books and read for three hours today before posting this. I'm super peaved at myself for not being able to figure this one out. Any help, a link or anything would be seriously appreciated!
TIA
|
|
|
|
|
It's really difficult to visualize by your post the problem you're having. Can you post the code for the form or show a screenshot of the problem? Most likely if you need resizing but don't want your controls to overlap other controls in the same parent via the resizing, you'll need a flow layout panel. But I'd really need to see what you need visually before answering your problem.
|
|
|
|
|
Apologies if this is basic but I can't make much sense of most of my searches (and I'm pretty much brand new to C#). I appreciate your help in advance.
Problem:
I have a picturebox (pictureBox1), which I want painted in a blended form from say silver at the top to red at the bottom.
I am aware of something like linear gradient brush but I can't get the syntax right. I get to a point where I write this:
//-----------------------------------------------------------------------
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
// nothing I try here seems to work!
}
//-----------------------------------------------------------------------
but nothing I try between the brackets seems to work, apart from "pictureBox1.BackColor = Color.Purple(or whatever)", but that's not what I'm after, I can't get a blending working. I know I have to create a brush somehow and tell it to paint it in a blending manner linearly from the starting color to the ending color, but I can't get the syntax right.
Can anyone give me some clues/a hand for/with the syntax? Thanks!
Rodrigo
P.S. Out of curiousity, does anyone know how to create custom shaped buttons?e.g. instead of having the window close button as a square having a button that's a half-moon shape or something. Cheers.
|
|
|
|
|
|
elsombreron wrote: P.S. Out of curiousity, does anyone know how to create custom shaped buttons?e.g. instead of having the window close button as a square having a button that's a half-moon shape or something. Cheers.
round buttons[^]
Alex
|
|
|
|
|
I have a Main Form that calls various subforms with the following code on a button:
private void btnForm2_Click(object sender, EventArgs e)
{
using (frmForm2 frmform2 = new frmForm2())
{
Hide();
frmform2.ShowDialog();
Show();
}
}
Then I have a single button on the other form(s) that has this code:
private void btnOK_Click(object sender, EventArgs e)
{
this.Close();
}
Everything works great the first run through. I click the button on the main form and it goes away and I get the other form. I click ok on that form and go back to the original. Great! But then if I click to go back to the same form or any form off of the main again. Once that form comes up and I click OK again <poof> nothing comes back. As that form closes the original seems like it might briefly be displayed (I see maybe a quick outline of it) before going into never-neverland. The application itself never exits and Im still in debug mode then.
I'm obviously doing something really stupid here... Any ideas?
|
|
|
|
|
I cant reproduce your problem. Please check if the MainForm goes behind any other windows that might be open (like Visual Studio).
---
"Drawing on my superior command of language I said nothing."
|
|
|
|
|
Well I did say it must be something stupid. Ok yes I have 100 things opened and it was beneath them, but I suppose essentially the same question comes around. Why do I get one result the first time through (The Main Screen shows back on top) and the second run through it does something totally different (The Main Screen shows behind other Windows). Or I suppose, more importantly, how do I fix it?
|
|
|
|
|
use BringToFront property of your main form
e.g.
Form2 frm = new Form2();<br />
this.Hide();<br />
frm.ShowDialog();<br />
this.Show();<br />
this.BringToFront();
|
|
|
|