|
Vipin Venugopal wrote: The best way to print from a window application is using crystal reports.
I bit of overkill if you ask me. Plus the overhead of CrystalReports, licensing etc.
only two letters away from being an asset
|
|
|
|
|
Hi guys,
A general question, is there a disadvantage/advantage of working with the registry or XML document. Do Admin rights issue come in if you are saving everything on the registry?
Please advice.
sasa
|
|
|
|
|
Off the top of my head, XML seems the safest. Because, even if the user had Power User privildges, they still can't edit other accounts - so some reg keys might not be accessable.
I'm running power user right now, and I can't install many things, e.g. Flash, VS Express, DirectX, WGA Plugin, Alcohol 120%, etc...
However, I CAN install firefox.
I'm not sure what the pattern is....
/\ |_ E X E GG
|
|
|
|
|
hi all,
how can i find index of selected cell in a row ?
i have a textbox on my form.
and i want to assign the selected cell's value to the textbox.
what should i write into which event ? selectionchanged ¿
help please...
thanks in advance,
bye.
|
|
|
|
|
use datagridview.SelectedCell.Row
this gives the row no.
Regards,
Pramod
|
|
|
|
|
i want 2 automate the proccess of login into site usin Htaccess.. and instead of enetering the user/pass in the annoying popup window i wanna login directly into the site.. .like http://user:pass@www.blah.com... but this is not available in IE..
so i wodered if there any way from c# (maybe using axWebBrowser, or something else) 2 fill the 2 fileds of user/pass automaticly into the pop up window, or skip it completly
cause i open the ie from c# like that:
System.Diagnostics.Process.Start("iexplore.exe",site)
and i have the user/pass already stored in xml file...
so i dont wanna retype it again int the pop up window of HTaccess
thx ahead!
-- modified at 6:21 Friday 4th August, 2006
|
|
|
|
|
Is there anyway to create a standalone dropdown button thats not in a toolbar strip?
Thanks, Ben.
|
|
|
|
|
You could make a custom control that would mimic the Toolbar Strip Drop Down Button.
Regards,
1tg46
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.
|
|
|
|
|
Greetings:
Im trying to change an image to only two colors (B&W) based on a threshold value, to do this i first turn it to grayscale using a colormatrix, then, if the rgb grey value is bigger than the threshold value it turns black, if its lower it turns white, or viceversa. As for now, im doing this pixel by pixel, but its too slow, is there a better, faster way for doing this, and if so how?
Thanks in advance
"Failure is the best reason to start all over again with more knowledge"
-Henry Ford
|
|
|
|
|
Heh, faster ? Shameless plug
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I use the Process class to launch a DOS program. At times the DOS program comes to a puse waiting for user input. I want to check if it is waitng for a user input. i searched and came across a method called Process.WaitForInputIdle . Hoever, this only seems to work with application with a GUI. What do i do? Is there another way i could check of the DOS program is waitng for user input?
|
|
|
|
|
I'm working on a Word add-in with a custom menu. When the Word is started, the Add-in is loaded and menu is created. But the same Word instance(Windows process) is used by Outlook and I don't want the menu to work if the current Word document is an email. We have other application which uses Word inside it as well. Window.EnvelopeVisible property just apply to Outlook. Is there any general way to find out whether a Word document is under another container application such as Outlook?
Thank you very much.
James
|
|
|
|
|
ok so perhaps not c# specific but its the language im using so...
i have some (hopefully) thread-safe code that accesses some shared fields using the lock statement but im trying to avoid full-on locking.
i need to update a field only if the result does not exceed some other value.
i found the following code for simple value update (in the CompareExchange() example):
do {
initialValue = totalValue;
computedValue = initialValue + addend;
} while (initialValue != Interlocked.CompareExchange(ref totalValue, computedValue, initialValue));
now, if i use the following would it be properly thread-safe and do wot i need..?
do {
initialValue = originalValue;
result = initialValue + addValue;
overFlag = result > maxValue;
if (overFlag) result = initialValue;
} while (initialValue != Interlocked.CompareExchange(ref originalValue, result, initialValue));
overFlag is bool and would be used after the udpate code to determine whether to continue or not.
i cant quite get my head around it.
thanks in advance
I worship his divine shadow.
|
|
|
|
|
Hello!
How do you reorder ToolStripMenuItems in MenuStrip at runtime?
Here's some sample code:
//create the MenuStrip here and add a File menu with an Exit MenuItem on it.
MenuStrip ms = new MenuStrip();
ToolStripMenuItem file = new ToolStripMenuItem("File");
ToolStripMenuItem fileExit = new ToolStripMenuItem("Exit");
file.DropDownItems.Add(fileExit);
ms.Items.Add(file);
//Add a Print MenuItem to the File Menu
ToolStripMenuItem filePrint = new ToolStripMenuItem("Print");
file.DropDownItems.Add(filePrint);
At this point, the File menu will have the Exit menu item, and then the Print menu item below it. How do you change the order, and move the Print menu item to the top?
Background: I'm creating a _MenuStrip control that inherits from MenuStrip, and will have default MenuItems for all menus in the application, such as File/Exit, and Help/About, etc. I plan on creating additional MenuStrips that inherit from my base _MenuStrip control, and I will need to add and remove MenuItems at runtime.
Thanks!
Gary
|
|
|
|
|
You can reorder them by changing the order they're in the DropDownItems collection.
file.DropDownItems.Remove(filePrint);
file.DropDownItems.Insert(0, filePrint);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Thank you very much! That does handle the reordering of the MenuItems.
There is only 1 caveat to this approach, that is that the EventHandler for the MenuItem that is being removed will be lost when the MenuItem is removed and re-inserted. How can you get the EventHandler for the MenuItem before it is removed, and then reassign it after it is added back again?
Thx.
|
|
|
|
|
Scratch that... I figured it out. Thanks!
Example:
ToolStripMenuItem tsMnu = new ToolStripMenuItem();
//Remove first menu item
tsMnu = (ToolStripMenuItem)((ToolStripMenuItem)this._MenuStrip1.Items[0]).DropDownItems[0];
((ToolStripMenuItem)this._MenuStrip1.Items[0]).DropDownItems.RemoveAt(0);
//Add Print MenuItem
((ToolStripMenuItem)this._MenuStrip1.Items[0]).DropDownItems.Insert(0, new ToolStripMenuItem("Print"));
//Re-insert the MenuItem below the Print MenuItem
((ToolStripMenuItem)this._MenuStrip1.Items[0]).DropDownItems.Insert(1, tsMnu);
Thanks!
|
|
|
|
|
It should be sufficient to insert the new item at index 0 as all other items should move down automatically.
((ToolStripMenuItem)this._MenuStrip1.Items[0]).DropDownItems.Insert(0, new ToolStripMenuItem("Print"));
"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 www.troschuetz.de
|
|
|
|
|
I have a form (a4 paper) that i digitalized (jpeg file) with my scanner. On this form there are many fields that can be manually compiled: name, surname, address, etc.
I'm looking for a source (example) in c# to do this:
1) Input variables by program: name, surname, address, etc;
2) Trasfering variables over the form (digitalized);
4) Print form with user's variables.
Can u help me ?
Thanks
Alv;)
|
|
|
|
|
1) You seriously need an example of this?
2) Graphics.DrawText
3) Skip this step, it's unnecessary
4) Research PrintDocument
only two letters away from being an asset
|
|
|
|
|
Thanks for your reply and excuse me for missing n. 3...
Where can i found a source-example in c# ?
|
|
|
|
|
|
Hello,
First of all please do not refer any previous articles on this website about my problem and try to point the problem and its solution.
Thanks in Advance!!!
I'm written some implementation about Single Instance Application. All is working fine.
When I run the second instance it stops itself if one already running in the following states of the main Form:
1) minimised
2) maximised
3) Normal
The only thing that is not working fine when the main Form is Hidden becuase of Form.Hide(); or Form.Visible = false;
Here is the code which i'm using to show the instace of already running application:
if (IsIconic(hWnd))<br />
ShowWindow(hWnd, SW_SHOWNORMAL);<br />
else<br />
ShowWindow(hWnd, SW_RESTORE);<br />
UpdateWindow(hWnd);
Please suggest an accurate solution to this problem.
I'll be really thankful to you.
Best Regards,
Rizwan Ahmed.
|
|
|
|
|
dotnetdev83 wrote: Please suggest an accurate solution to this problem.
I would but I'd just refer you to this site.;P
dotnetdev83 wrote: please do not refer any previous articles on this website
only two letters away from being an asset
|
|
|
|
|
That is what I'm doing right now
Anyways, Thanks,
Regards,
Rizwan
|
|
|
|