|
The code I had posted does the same. What did you tried? Some code would be of help.
|
|
|
|
|
Your code only draws one circle at the center of the dialog. What if I want to draw two circles of different radius at the same center.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Use the method two times. Was it this tough?
|
|
|
|
|
You didn't read the documentation of DrawEllipse probably.
DrawEllipse - Draws an ellipse defined by a bounding rectangle specified by a pair of coordinates, a height, and a width. So we need to draw the bounding rectangle at the same center coordinates. Right?
When I use your code it draws an ellipse starting at the coordinates(left top corner) you provide and with the width and height, and so the circles are not concentric.
Anyways I have resolved the problem now.
Thanks for your time and effort in helping me.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Somehow, these look concentric to me.
gx.Clear(this.BackColor);
gx = this.CreateGraphics();
gx.DrawEllipse(Pens.Red, (this.Width / 2 - 25), (this.Height / 2 - 25), 50, 50);
gx.DrawEllipse(Pens.Red, (this.Width / 2 - 50), (this.Height / 2 - 50), 100, 100);
gx.DrawEllipse(Pens.Red, (this.Width / 2 - 75), (this.Height / 2 - 75), 150, 150);
gx.DrawEllipse(Pens.Red, (this.Width / 2 - 100), (this.Height / 2 - 100), 200, 200);
|
|
|
|
|
d@nish wrote: gx.DrawEllipse(Pens.Red, (this.Width / 2 - 25
aren't you hardcoding the values for the rectangle. you are fixing the centers by subtracting some values based on the radius. isn't it? your circles won't get drawn with the same center when you increase or decrease forms size.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Only thing I have fixed is the radius of the circles, and that is because this is just some sample code.
You need to handle the Resize event for the form as well and only then, no matter how you resize the form, the circles will be drawn with form's center as their center.
|
|
|
|
|
Are you some sort of idiot?!
How can you have fixed the problem when you cant even see the simple logic that is shown in the code provided by d@nish?
If you put his code is the form's paint event then it will always draw in the centre of the form. And as for saying it only draws one circle - then no f%&^ing $^!t. you want two circles then you use DrawEllipse method two times! Guess how many times you call the method if you want three circles?!? 3 times!!!!!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi..
In my project, want to create Timed license key in c#. for example, if give one month license, the license allowed to work only a single month after that the software indicate date expiry. How can handle this..
Thanks...
|
|
|
|
|
you could have a config file that stores the date the application was first used (not secure)
you could store the date in the system registry (still not secure, but better)
you could get third party licensing software (security depends on the product)
Take a look here[^] for a good example.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
Hello
I am running into "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" and I managed to get around it by setting oParam.Size to length of command text instead of the parameter itself!?!
The stored proc signature is
<br />
CREATE OR REPLACE PROCEDURE spXXXXX (<br />
TestId varchar2,<br />
bAllTestCleared OUT varchar2<br />
)<br />
...
And my code/C# - yes first place I checked is that I have set parameter size of course:
<br />
void SomeTest()<br />
{<br />
IDbConnection oConn = null;<br />
IDbCommand oCmd = null;<br />
IDataParameter oParam = null;<br />
IDataParameter oOutParam = null;<br />
<br />
string strTestId = null;<br />
<br />
object oReturnValRaw = null;<br />
<br />
try<br />
{<br />
strTestId = Guid.NewGuid().ToString();<br />
...<br />
oConn = DBUtil.GetDefaultDBConnection();<br />
oConn.Open();<br />
<br />
oCmd = oConn.CreateCommand();<br />
oCmd.CommandText = "spXXXXX";<br />
oCmd.CommandType = System.Data.CommandType.StoredProcedure;<br />
<br />
oParam = oCmd.CreateParameter();<br />
oParam.Value = strTestId;<br />
oParam.ParameterName = ":TestId";<br />
oParam.DbType = DbType.String;<br />
((OracleParameter) oParam).Size = strTestId.Length;
oParam.Direction = ParameterDirection.Input;<br />
oCmd.Parameters.Add(oParam);<br />
<br />
oOutParam = oCmd.CreateParameter();<br />
oOutParam.ParameterName = ":bAllTestCleared";<br />
oOutParam.DbType = DbType.String;
((OracleParameter) oOutParam).Size = 1;
oOutParam.Direction = ParameterDirection.Output;<br />
oCmd.Parameters.Add(oOutParam);<br />
<br />
oCmd.ExecuteNonQuery();<br />
<br />
oReturnValRaw = oOutParam.Value;<br />
...<br />
}<br />
catch (Exception ex)<br />
{<br />
...<br />
} finally {...}<br />
}<br />
Any suggestion? Is this a bug?
http://forums.oracle.com/forums/thread.jspa?messageID=3258848
Thanks
dev
modified on Monday, June 29, 2009 2:47 AM
|
|
|
|
|
Hi,
I just completed two articles on Silverlight. The first is real basic 1.0 stuff. The second is 2.0 and more architechuraly involved but geard toward developers. I would like some community feed back and any performance results you find while testing the code. I am working on an older Pentuim 4 willimina with low memory. I'm getting bad performance results, I'd like to know what beefier systems report.
Thanks,
~TheArch
XAML Graphics Series - Part 2 Silverlight 2.0 Desktop Art Animation[^]
|
|
|
|
|
|
Hi,
the error message "not all code paths return a value" is clear: there is at least one way of traversing your method without encountering either a "return value;" statement or an abnormal exit (an Exception being thrown).
PS: showing your code in PRE tags would improve readability and make it easier to spot the problem.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
please don't delete messages, it is considered rude and makes for a messy forum, leaving part of a thread.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
hello
What are the common issues when you try to port your application to run on 64 bit windows? Is this pretty the only/first issue you'd run into?
<br />
Solution<br />
> Configuration<br />
> Configuration Manager<br />
> Platform<br />
> select "New"<br />
> You can then choose x86 (32 bit) or x64 (64 bit)<br />
Thanks
dev
|
|
|
|
|
I found that marking my app as being 32 bit forced compatibility mode in 64 bit, which was all I ever needed to do ( of course, this means it runs as 32 bit ).
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
anyone who can give me one simple but good example to demonstrate that application domain has to be used.
because I found most examples for application domain can not demonstrate clearly that the necessity of application domain.
thanks.
|
|
|
|
|
This [^]might be an answer to your question.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks.
but I still can not find some concret examples. It seems to me most people did not use it often.
this may be the reason that it is hard to find some good practical examples.
|
|
|
|
|
I use an App Domain to load config files into a process and associate it with a DLL. I blogged about a variant of my code here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Every .NET application will have an application domain associated with it and it will be created automatically. Creating your own application domains helps you when you are dealing with plugin kind of architecture. Each plugin can be loaded on a new application domain and it can work isolated.
If you are familiar with NUnit, they use a new application domain to load the assemblies specified by the user. This will help them to isolate user code execution and proper resource and memory cleanups. When an application domain is unloaded, all the memory associated with it will be cleared.
Hope that makes it clear
|
|
|
|
|
how to implement the nested string case?
such as
string str="MessageBox.Show("hello")";
above code has compiled error anyway.
but how to do then?
thanks.
|
|
|
|
|
"MessageBox.Show(\"hello\")";
|
|
|
|