TaW
Nov 26, 2020 12:08
ok. bye..
TaW
Nov 26, 2020 11:59
Also: Is the click event even hooked up (i.e. registered)?? Look in the button's properties-event pane and check that the Click event has the button1_Click !
TaW
Nov 26, 2020 11:57
In which line exactly is the breakpoint?
TaW
Nov 26, 2020 11:57
You did set the beakpoint? and then started the program? If not press F5 ! Now your button should come up and when you click it the debugger should stop at the breakpoint..
TaW
Nov 26, 2020 11:57
Looks even better. But still the dialog ought to show up in any case. Do us all a favor and use your best friend, the debugger!
TaW
Nov 26, 2020 11:57
Then now is the time to learn it! Really !! Just add a breakpoint at the line with the showdialog and step once.. To set a breakpoint click at the grey part to the left of the line number. It will creat a dark red circle.. - To step press F11 !
TaW
Nov 26, 2020 11:57
What are you targetting: Winforms, WPF, ASP..? YOU should always TAG your questions correctly so one can see it on the questions page! - the window disappears right away Really??? You should set up the dialog befor you show it but it should show just fine. Of course the stuff you later do will not show.. - And you need to use the dialog, not some openFileDialog1 !!
 
TaW
Jun 25, 2020 00:02
Has it been compiled at least once?
TaW
Jun 25, 2020 00:02
Well you have already typed in a few characters, so it only shows words starting with (or at least containing) these characters
 
TaW
May 5, 2020 19:04
cool. night..
TaW
May 5, 2020 18:10
A typo, but you'll have to debug this yourself - This seems to work here. Note the change in the codition.: `int p = series_2.Points.AddXY(ipp[i], pgc[i]);
if (i> 0) series_2.Points[p].Color = pgc[i - 1] <= pgc[i] ? Color.Green : Color.Red;}`
TaW
May 5, 2020 18:03
Ah, yes, I think I messed it up a little. Try this int p = series_2.Points.AddXY(ipp[i], pgc[i]); if (i<ipp.Length-1) {int p = series_2.Points.AddXY(ipp[i], pgc[i]); if (i <ipp.Length-1) series_2.Points[p].Color = ipp[i - 1] > ipp[i] ? Color.Green : Color.Red;}
TaW
May 5, 2020 18:03
if (i<ipp.Length-1) {int p = series_2.Points.AddXY(ipp[i], pgc[i]); series_2.Points[p].Color = ipp[i + 1] > ipp[i] ? Color.Green : Color.Red;} - Puttin this in the 1st loop and omitting the 2nd one should work..
TaW
May 5, 2020 18:03
Line charts will always connect all points. So, it may be simpler to use only one Series for those extra lines. You can color each line separately by coloring its 2nd point. Or you can add transparent points to skip segments. Modify the is else clauses to always add a point to each series, but some with a transparent color..
 
TaW
Apr 17, 2020 16:24
Dinner is over. don't know if we could open a private chat. In Winforms a GraphicsPath can be complex and include holes but I really can't advise without knowing a lot more.. Good luck!
TaW
Apr 17, 2020 14:54
Sure, go ahead..
TaW
Apr 17, 2020 14:53
How exactly do you then draw them? - What are you targetting: Winforms, WPF, ASP..? YOU should always TAG your questions correctly so one can see it on the questions page!
TaW
Apr 17, 2020 14:53
Well, keep the coodinates/graphicspaths and test which contain the mouse point..
TaW
Apr 17, 2020 14:53
Where do the shapes come from? Do you draw themß Then you can easily remeber them and test which were hit..
TaW
Apr 17, 2020 14:53
Lets simplify the issue by looking athe channels separately. If we assume a simplistic blending mode that simply adds all channels Even the 1st color can be anything as the two others will be able to get to 100. If the target values 255 otoh only one solution is possible. ((Aside: Do note that the GDI color blending is quite crappy and doesn't work that way and all those ideas will not be be possible to achieve with simple gdi drawing code!)
TaW
Apr 17, 2020 14:53
While color/alpha blending can be quite complex (to wit: look at the photoshop modes!) your case will be solvable for some cases : picking n pixels with different colors results in n equations and these can be solved if only n shapes are used and all combinations/overlapping are present. If two shapes are identical their colors cannnot be reconstructed.
 
TaW
Sep 2, 2019 08:54
Also: It may help to show the drawing code. Maybe all you really need is some additional space between the lines?
TaW
Sep 2, 2019 08:50
So? Isn't that what you already do? But: With what do you want to fill the empty space at the bottom? You really should post an image of what you want to see!
TaW
Sep 2, 2019 06:14
Well if everything is given the problem can't be solved. Your text is too short, unless you accept changing, say, the line distance (leading). To find out the number of lines you could use the MeasureString(String, Font, SizeF, StringFormat, Int32, Int32) overload of DrawString. Then find out the font Height..1
TaW
Sep 2, 2019 01:28
But you don't change the font, right? So, if there is not enough text, how could it work? Not sure if supplying the maximum size is the same as supplying the width to find out the current height.
TaW
Sep 1, 2019 22:11
He wants to fill to the bottom, not to the right.
TaW
Sep 1, 2019 22:00
Here is what you could do: MeasureString returns a Rectangle when you feed in the maximum width. Then you can compare its height with your target height and if it is too low you can increase the font and repeat.
TaW
Sep 1, 2019 21:58
Hm, maybe I didn't get your question right. Are you maybe not talking about the tight border but about the bottom space??
TaW
Sep 1, 2019 21:58
Yes it does but that usually will not add up to the full line length. bibendum is too long so it goes to the next line, leaving the previous one short. Or don't you aim at block alignment?? - The param is called StringFormat.GenericTypographic
TaW
Sep 1, 2019 21:58
OK, for this result you actually don't need any code at all; you could use the drawstring overload that take a target rectangle. But for justified output you need a more elaborate code that calulates how many white space characters are missing and them adds them between words.. - (Professional software also sometimes uses extra thin spaces between letters..)
TaW
Sep 1, 2019 21:58
Words will not accidentally fill lines properly. so you need to add extra spaces between them to achive block alignment.
TaW
Sep 1, 2019 21:58
For this kind of thing try to add the typographic parmater to the measurestring call. I don't quite follow the code: do you add any spaces to the lines to fill them up? This will be necessary. I would consider not using regular spaces for this but n-space charcters. They are wider and can be removed if necessary.
 
TaW
Jul 7, 2019 01:59
so this high spike in memory is not considered as leak Indeed. A leak is memory that is lost until the application is closed. You spikes are just the system optimizing for speed at the temporary cost of memory.
TaW
Jul 7, 2019 01:59
My verdict is: You do not have a memory leak.
TaW
Jul 7, 2019 01:59
I can't say that I see that you are actually describing a memory leak. Which would be a case where memory consumption does not spike but grows all the time. Does it reach a limit or does it keep growing?? - 130 GDI objects is not a problem. The problems come when this number also keeps climbing..
TaW
Jul 7, 2019 01:59
That's a nice chunk of RAM. Whicjh means there is plenty to use and little need to regain it quickly. so you may not even hava a real problem. Can you also check the GDI handles? (In one of the the taskmanager panes) ?
TaW
Jul 7, 2019 01:59
Are you sure you actually have a leak or simply enough RAM so GC isn't needed for long stretches? High RAM usage != leak !
 
TaW
May 31, 2019 22:06
With enough undermining the community will fall.
 
TaW
Apr 27, 2019 14:52
Glad to be of help.. Bye!
TaW
Apr 27, 2019 14:39
Well, if you know the range where the keys are, my post should help you find the row. If you don't know the keys' range you could search the whole column, I belive by creating the range just from the column like so: Excel.Range range1 = ws.Range["C:C"];
TaW
Apr 27, 2019 14:17
Huh? didn't you write that the keys are in the 1st and the values in the 2nd column??
TaW
Apr 27, 2019 14:08
I would assume you know the colum, no?
TaW
Apr 27, 2019 14:08
Hi. I postend an example. Does it help?
TaW
Apr 27, 2019 14:07
Ah, ok. I wouldn't do the lookup in excel but pull all into one dictionary, but it really depends on how many data there are and how often you need to access them. For direct access this or this may help..
TaW
Apr 27, 2019 14:07
So, what is the issue: Reading a cell, reading two cells or reading a range of pairs of cells? It really shouldn't be different from reading any other data as in many examples out there..
TaW
Apr 27, 2019 14:07
How do they look in the excel sheet?
 
TaW
Apr 10, 2019 12:54
Good luck then :-)
TaW
Apr 10, 2019 12:48
OK; this is what I meant when I wrote: Note that as the rectangle doesn't sit at the origin its transform will not sit at the mouse location. You will have to add/subtract the offset(location) of the rectangle from the mouse position...: MatTranslate.Translate(e.X - rect.X, e.Y - rect.Y);
TaW
Apr 10, 2019 12:43
thanks
TaW
Apr 10, 2019 12:27
Maybe.Try!