|
point p=new point(Screen.PrimaryScreen.WorkingArea.Width-this.Width,Screen.PrimaryScreen.WorkingArea.Height-this.Height-30);
this.location=p;
|
|
|
|
|
in the first form i have a table of labels of categories(history, geography, etc...)and a label that counts the money that i have (we start by a certain number of money) so when i click on a label a question must appear in a new form, i answer the question and i claculate the new amout of money, i close the new form and return to the initial form where the label that counts the money must be uptadeted... the problem is when i come back to the initial form the label shows the initial amout that i have initially entered without being uptated.. even though i declared a public class
|
|
|
|
|
Hi,
could you send code, how you open the 2nd form? That would help
bye
|
|
|
|
|
in the event label_click (first form)
{
form2 f2=new form2();
f2.ShowDialog();
}
that's all ....
|
|
|
|
|
Hi,
after ShowDialog() you should update your label manually. The event will stop until your form closed, at ShowDialog()
hope it helps
bye
|
|
|
|
|
You need some method to actually trigger the update of the label. If you've used databinding against the label, you can update it using INotifyPropertyChanged . Alternatively, you have to manually trigger the update yourself.
"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
|
|
|
|
|
i want to check if a given point (x,y) lies inside a region. I know only the edge coordinates of the region( a list of points). the region is an irregularly shaped region.
i have tried out many solutions but havent got a proper answer yet. pls help me out.
thank u.
|
|
|
|
|
Try here[^]
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
thanks.
the solution looks great. my region is actually a curve and i know the coordinates of every pixel. can i consider the curve to be a polygon??
can i form the arrays polyX and polyY from the coordinate values of every pixel??
|
|
|
|
|
If you already know the co-ords of every pixel on your region boundary, it is even easier isn't it? Just count the number of pixels with the same x (or y) value which have a lower y (or x) value, and if it is zero or even you are outside, odd and you are inside.
You would have to count intersections twice, but that is just a tweak.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
Oops! I forgot - you will need to check if the border is a horizontal (or veritical) line!
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
ya ok. i'll try it out n let u know. thanks!
|
|
|
|
|
|
adding to the excellent answers so far, here is a simple trick that sometimes fits the job:
if you are working in an integer coordinate system with limited range, you could fill your region with one foreground color onto a different background color once, then just ask the pixel what color it has...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
this will work great if i knew the color values of the values. but i know only the positions and nothing else
|
|
|
|
|
You set the values yourself. If it is inside the shape, assign a specific value(say magenta), else use default.
Ask pixel what color it is. If magenta then inside polygon = true.
|
|
|
|
|
It doesn't matter. Just call it black, or whatever. There are only 2 colours so you could use a single bit per pixel to cut down on memory usage. It seems logical to me to visualize that as white on a black background, but it doesn't matter since you only need to know which colour it is, not what colour it is (if you know what I mean), you might as well visualize it as yellow on pink, it doesn't change the result
|
|
|
|
|
there are only two colors involved. Build a GraphicsPath and use Graphics.FillPath; I am not sure how it fills when edges intersect, you'll have to test it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
I may be making a mistake here but doesn't GraphicsPath has a method to do exactly this?
bool GraphicsPath.IsVisible(Point)
[Indicates whether the specified point is contained within this GraphicsPath.]
|
|
|
|
|
Nice, I keep forgetting that method exists. It means we don't need a bitmap after all, which makes overall sizes and integral values irrelevant. Construct the path and interrogate it!
FWIW: when lots of points have to be checked, a bitmapped approach may still be the faster solution.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
HA HA HA... I thought that when many people have suggested such elite answers, i might not be understanding problem correctly... ha ha ha...
cheers!!!
|
|
|
|
|
I just finished a little article on the subject, see here[^]. Hope you like it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
i made web application to scan pages from scanner and worked well but when i made the project on IIS it is not work well and get me this problem
Description: An unhandled exception occurred during the execution<br/> of the current web request. Please review the stack trace<br/> for more information about the error and where it originated in the code<br/> Exception Details: System.UnauthorizedAccessException: Creating<br/> an instance of the COM component with CLSID {850D1D11-70F3-4BE5-9A11-77AA6B2BB201}<br/>from the IClassFactory failed due to the following<br/> error: 80070005. ASP.NET is not authorized to access the requested resource.<br/> Consider granting access rights to the resource to the ASP.NET request identity.<br/> ASP.NET has a base process identity </br>(typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is <br/>not impersonating. If the application is impersonating via <br/>identity impersonate="true, the identity will be the anonymous user (typically IUSR_MACHINENAME)<br/> or the authenticated request user.<br/> To grant ASP.NET access to a file, right-click the file in Explorer,<br/> choose "Properties" and select the Security tab.<br/> Click "Add" to add the </br>appropriate user or group. Highlight the ASP.NET account,<br/> and check the boxes for the desired access.Source Error:
Line 26: int x = 0;<br />
Line 27: <br />
Line 28: CommonDialogClass class1 = new CommonDialogClass();<br />
Line 29: Device d = class1.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);<br />
Line 30: if (d != null)
please any one know the Answer please reply to me quickly i need this now
|
|
|
|
|
I am also getg the same pblm tried all gave rights to all users for the dll still getg the same error can sme one post me the solution....
|
|
|
|
|
Hi,
Did any one got solution, am also facing same problem
Chandrashekar T N
|
|
|
|