|
Hello!
On the graph display we have many overlapped text. Is there any good algorithms to resolve this problem, so that we have a readable layout ?
Thanks
|
|
|
|
|
Please don't post to every forum.
You can request the metrics of the test in C# and also C++, and use that to work out if items overlap. You're basically talking about overlapping rectangles, no fancy algorithms are needed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My appology for posting to two forums.
The problems is: overlapped label inside a densed polygon on map. Each polygon has a label (ex. town name). The label should be placed to ensure readability while still reside in that polygon.
Your comments woulds be very helpful.
|
|
|
|
|
OK - that's a bit harder In that case, I guess you could start by centering the text over the point that denotes the location, then check if any overlap, and if they do, then decide on a solution. Your only options will be to change the font size, move the text about, or put some text below the dot and some above, as far as I can see.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Does anyone know how in C# to test for the state of the Scroll Lock key?
Thanks,
David
|
|
|
|
|
If you use .NET 2.0, you can use the call Control.IsKeyLocked( Keys.Scroll ) call to get a bool that indicates the value for which you look.
If you use .NET 1.0 or 1.1, you need to look at GetKeyState[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Curtis,
Thanks for the info I knew there had to be a way, just could not find it in the doc's of 1.1.
|
|
|
|
|
is there any way to intercept and control what to do based on the Content-Type of the page with the WebBrowser control? I am trying to capture and save the asx file instead of automatically opening and playing in media player. I have tried to intercept it on DownloadComplete, Navigating, Navigated events and none of them worked.
Any suggestions is welcome!!
|
|
|
|
|
|
|
Are there any examples out there that I can take a look at the usage of this function? I tried using the function and it resulted in build errors.
Also, does this function allow me to put in my own code to handle the content for a specific content-type? I got a bit confused reading the doc.
Thanks for the help!
|
|
|
|
|
|
In a windows form I have a textbox and a button. Initially the text box contains "Enter ID" as the default text. I enter some ID and click the button which saves the ID to an XML. After that, the text in the textbox should revert back to "Enter ID" as before.
Right now my code is a below...
// Windows Form Designer generated code
// First time I intialize the dafault text
this.txtbox1.Text = "Enter ID";
// Button_click
private void button1_Click(object sender, System.EventArgs e)
{
//Write To File and reset all textboxes on the form for default text
SaveToXML();
ResetAllTextBoxes();
}
// Reset all text boxes on the window
private void ResetAllTextBoxes()
{
this.textbox1.Text = "Enter ID";
....
....
this.textbox10.Text = "There has to be some another way"
}
I'm not satisfied with this implementation because if I have 10 textboxes I need to have 20 lines of code doing the same. 10 lines in the Windows Form Designer generated code and 10 in ResetAllTextBoxes() method.
I tried the textbox1.ResetText() method but instead of reseting it to default text such as "Enter ID" it resets to blank.
Is there a better solution.
Thanks
----------
Venus Patel
http://patelsinc.blogspot.com/
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
-- modified at 17:25 Tuesday 10th January, 2006
|
|
|
|
|
No. You have to write the code to change the values, and the auto generated code will stay the same. Personally, I would not set the values in the forms designer, but just in a method, and call the method after InitializeComponents is called, just to put it all in one place.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You could make your own custom textbox that inherits the built in textbox, and that has a DefaultText property. To easily reset all textboxes, keep a static Arraylist in the class, where each textbox adds a reference to itself when it is created. Then add a static method to the class that loops through the Arraylist and resets the text of each textbox.
---
b { font-weight: normal; }
|
|
|
|
|
I've added a Shockwave object to my WinForm and I'd like to have it respond to a mouse click.
Is there anyway to do this?
I've seen stuff that says you can catch the FSCommand event - the problem is I'm using just plain ordinary SWFs and I can't guarantee that they will have an FSCommand.
TIA - Jeff
|
|
|
|
|
|
Hi, I am writing a small program that opens a very large (almost 4GB) XML file, then looks through the data for various text matches etc. (I don't need to display or write to the XML file).
The problem I have is using the following code to open the XML file;
StreamReader sr = new StreamReader(Filename);
XmlTextReader xr = new XmlTextReader(sr);
XmlDocument XMLdoc = new XmlDocument();
XMLdoc.Load(xr);
This loads the entire file, which causes an OutOfMemoryException error when it reaches the 2GB limit. It works ok for small XML files that I have been testing on, but I dont know how to deal with this massive file.
I assume I am meant to open the file in chunks or something, but I haven't been able to find any info on how acheive this (other than upgrading to 64bit, but that isnt really practical).
Can anybody point me in the right direction?
thanks!
|
|
|
|
|
You could parse the nodes yourself if the file has a basically simple structure, e.g. something similar to:
<root><br />
<node ... >...</node><br />
<node ... >...</node><br />
<node ... >...</node><br />
<node ... >...</node><br />
<node ... >...</node><br />
... lots'a nodes<br />
<node ... >...</node><br />
</root>
By reading the file in small parts, you could extract the complete nodes you find in that part of the file, put them in a separate xml document in a string and load it into a XmlDocument object.
Pseudo code:
buffer = ""<br />
loop {<br />
buffer += stream.Read(lotsabytes)<br />
find first "<node>" in buffer<br />
find last "</node>" in buffer<br />
nodes = get what's between<br />
buffer = what's after<br />
xmldoc.LoadXml("<root>" + nodes+ "</root>")<br />
... do whatever you want with the nodes<br />
}
---
b { font-weight: normal; }<
|
|
|
|
|
I see what you're getting at, thanks!
|
|
|
|
|
I believe the XMLDataReader provides a solution that reads the file as it parses it. If not, there must be some control that works as SAX instead of DOM, and doesn't hold the whole file in memory.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, take the SAX approach -- open it as a Stream and use XmlTextReader. Not only will it help in not running out of memory, but it would be faster than the DOM approach even if you did have enough memory to load the whole thing.
Stream stream = new FileStream(fileName, FileMode.Open);
XmlTextReader reader = new XmlTextReader(stream);
reader.WhitespaceHandling = WhitespaceHandling.None;
while (reader.Read())
{
...
}
This is also a lot better idea than parsing the file with regular expressions, or worse, junk like text.IndexOf(blah) , especially when you consider the fact that there is no guaranteed that a whole xml file isn't a single line of text (then you are back to loading the whole thing into memory, probably).
Matt Gerrans
|
|
|
|
|
Thanks guys, I should mange from here!.
|
|
|
|
|
> Thanks guys, I should mange from here!
Hmm... I think soap and water will help with that. If not you should probably see a doctor.
Matt Gerrans
|
|
|
|
|
I have a custom control that I'm writing, and one of its properties is a collection. Everything works fine, except that the collection property shows a bolded (Conditions) value for it. I'd like to remove the bolding, and I'm ditzing on how to do this. Any ideas?
Thanks in advance.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|