|
I think the button has the last word there... as when I draw it in an overridden OnPaint method for the form.. the buttons occlude the lines.
I have not looked to see if the buttons are being invalidated unnecessarily. I will check that.
|
|
|
|
|
You are not the first to try this.
Have a look at Andrew Parsons story[^]
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for the tip.. he seems to be having the exact problem I am..
I like the idea of drawing to a tranparent panel as an overlay.. but I haven't been able to set up a transparent panel..
anyone have tips or tricks for this?
James
|
|
|
|
|
Transparent is not transparent. Setting the BackColor to transparent only tells the control to take on the background settings of its parent container, usually the Form. So, if the form is gray, the background of the Panel will be gray. You can't actually "see through" a "transparent" panel.
|
|
|
|
|
I want to process lines of a .Doc ms-word file in c#.net,I have searched in MSDN but it didn't help.If any one give me a hint OR name of right term to search in MSDN or internet, please?
Regards
M.Neishaboori
|
|
|
|
|
Hi,
for Office 2003 and higher, there is a downloadable "Office PIA" (Primary
Interop Assembly)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
In addition to what Luc said, I believe the PIA only work if Word is installed on the machine that runs your code, but the new docx format is just a zip file with XML in it, so if you work on the new docx format, it's probably a lot easier to get to where you want to be.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In addition to Luc and Christain :P
If you are using older version of Word you'll need to delve into the wonderful world of Structed Storage files, also known as Compound Documents (because having one name would be too easy).
Doing searchs on stuff like "c# structured storage" should give you code for handling these files and a search like "word file format" should through up sites where they have reverse engineered the format so you can tell what property 80010125 is :P
|
|
|
|
|
Hi,
Thank you all guys.I'll keep try!
M.Neishaboori
|
|
|
|
|
I've programmed a button, called 'Remove' to delete items, by counting the amount of selections, and than by a for-loop, doing listbox.remove, and when the loop is done, all selected items were deleted. But it just doesn't seem so userfriendly with this button.
Does listbox have something simple that allows the delete-key the do the same as the remove-method? Or should I be thinking in terms of making an event for listbox, and check if the 'DEL'-key was pressed, and then execute the same code as with my button?
Thanks in advance
|
|
|
|
|
Hi,
I would use ListBox.KeyDown event and a foreach loop over ListBox.SelectedItems
to call ListBox.Remove
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I can't delete it as it has been answered....
Hi - gone totally blank on this, up against the clock, and hoping somebody can patronisingly explain this one...
I have a Button on a webpage, which when clicked, generates a word doc, via automation, and saves it to a share. All done server side. Code simlar to the following (which doesn't work):-
protected void OnGenerateDoc( object sender , EventArgs args )
{
MyDocGen gen = new MyDocGen();
gen.CreateDocAndSaveHere(@"\\publicserver\publicshare\wellknownfilename.doc");
(HttpContext.Current.CurrentHandler as Page).ClientScript.RegisterClientScriptBlock(this.GetType()
, "myScriptKey", "alert('your document is ready');");
}
The alert command should be any javascript function that can be called. I just want it called when my stuff is complete. Any ideas? This is all in a custom control, in a DLL , hence the long winded way to get to the ClientScript . Is this the correct way of getting a reference to the page? Last modified: 54mins after originally posted --
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|
|
Malcolm, I don't know the answer, but it sounds a lot like a web-development specific question. Have you tried asking this in the ASP.NET forum[^]?
|
|
|
|
|
Hello, I have a quick question. Does anybody know how to find out how many processors are on the machine my app is running on? I've been drudging through System.Diagnostics to no avail, and I was wondering if anyone could point me in the right direction. Certainly there must be a constant or a property with a get accessor somewhere... but I just can't seem to find it.
Thank you.
-Gatsby
|
|
|
|
|
WMI has a wealth of hardware information. I'm not sure if theres a direct .Net class with the info in it.
|
|
|
|
|
If your going to 1 vote atleast explain why, and how the post could be improved.
|
|
|
|
|
Use WMI. Try the following:
string cpuInfo = String.Empty;
string temp = String.Empty;
ManagementClass mc = new ManagementClass("Win32_Processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (cpuInfo == String.Empty)
{
cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
}
}
Console.WriteLine(cpuInfo);
Console.ReadLine();
Don't forget to include the System.Management Namespace.
Mustafa Ismail
There are 10 kinds of people in this world. Those who understand binary and those who don't...
______________________
"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
|
|
|
|
|
Hi,
that is a complex question, and I don't have the complete answer.
What do you call a processor (there is some disagreement):
- there is hyperthreading (basically 2 or more processor states sharing all other
processor resources: functional units, caches, bus interface, ...), which you
can disable through BIOS
- there is multi-processing on a chip
- there is multi-chip packages
- and finally visible multi-processing: more than one IC package
And obviously these can be combined.
That's the technical view. Then there is the matter of software licensing,
which exists in many forms, such as per processor, per system, per seat.
There is room for debate!
Environment.ProcessorCount "Gets the number of processors on the current machine"
whatever that means. I expect/hope it to mean the largest number you can obtain
taking into account all the forementioned possibilities.
Also Process.ProcessorAffinity should have the value 2^n - 1 when
n=Environment.ProcessorCount
Hope this helps
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
That does help, quite alot! Combined with the other replies, I'm all set. Thanks!
-Gatsby
|
|
|
|
|
System.Environment.ProcessorCount will give you number of them (actually in some cases will return number of cores not processors just like DeviceManager!)
but if you need to know how many processors are on the machine really you can use WMI to found out
and it would be somewhat like this
static int ProcessorCount()
{
ManagementObjectSearcher mos = new ManagementObjectSearcher(new SelectQuery("Win32_Processor"));
ManagementObjectCollection moc = mos.Get();
List<string> processorIds = new List<string>();
foreach (ManagementObject mo in moc)
{
string pID = mo.Properties["ProcessorId"].Value as string;
if (!processorIds.Contains(pID))
processorIds.Add(pID);
}
return processorIds.Count;
}
in the code, processorIds were checked and because the cores from the same processor have identical processorIds they're not gonna be counted twice or more
hope the post would be useful
good luck
|
|
|
|
|
Quite helpful! Problem solved. Thank you.
-Gatsby
|
|
|
|
|
Hi,
I am trying to convert a Delphi project to c# project. As part of the project a C-dll is called to conduct simulation (pipe network analysis).
On some of the forms I have placed ZedGraph control. I am able to create these forms immediately before conducting simulation (i.e., before calling unmanaged C dll). However, immediately after simulation (i.e., after calling unmanaged C dll function), I am not able to create these forms. When I try to create these forms the application is abruptly getting terminated. I tried to locate the problem, and found that termination is occuring inside InitializeComponents() function (in particular, it is occuring when trying to initialize zedGraph control). All other forms (which do not contain ZedGraph) are working fine. I am not able to pinpoint the error. Anyone outhere could you please help me in correcting the mistake.
I should point out that the C-dll is working perfectly well as I can see the simulation reasults. However I do not know whether it is corrupting any memory. I can email the source code if anyone is willng to investigate it. I cannot post it here because it is a relatively large project. It will be made available as a freeware very soon.
Thanks in advance.
Regards,
Prasad
|
|
|
|
|
Prasad, you're not likely to get an answer to your question, and here's why:
1. No meaningful subject line, unlikely to attract people to see your question.
2. No specific question; e.g. you just describe an error and say you'll email someone with the source code.
3. Usage of specialized software: you're encountering a problem with the ZedGraph control. We don't know what this is. Perhaps this question is better suited to the support staff for that software.
|
|
|
|
|
I have a wide dropdown combobox on a form. I would like to move the button that activates the dropdown list from the right to the left side of the
combobox. I am aware of the RTL property but it also right aligns the text.
Does anyone have a soultion to this problem?
Thanks
James Johnson
|
|
|
|
|
Sorry James, can't be done. I work in a part of the world where RTL is the norm. Short of building your own combobox, there is no ready solution.
There are 10 kinds of people in this world. Those who understand binary and those who don't...
______________________
"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
|
|
|
|