|
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
|
|
|
|
|
dotnetdev83 wrote: 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.
Why would you say that?
|
|
|
|
|
Because I have already explored all the articles and concluded my solution on the basis of the best implementations.
All work good but not with the scenirio, I'm facing "The Hidden Form"
By the way, I'm interested in Vista Develpement Specially, WPF and WCF. Any guide lines?
Best Regards,
Rizwan Ahmed.
|
|
|
|
|
I am using a Deployment project to deploy my C# application (VS 2003). In the Uninstall event I want to get the installation directory that was selected by the user when they installed the program but can't seem to get this.
Application.StartUp path returns the path to the msi file that is executing not the installation directory.
|
|
|
|
|
Hello Devs,
I'm facing a very strange problem in Windows Form Application using Visual Studio 2005.
I have a lot of controls on my Windows Forms like TableLayoutPanels, TextBoxes, RichTextBoxes, Buttons.
I set their TabIndexes appropriatley from 0,1,2,3.....
When I run the application The cursor focus is not on the control whoes TabIndex Property is se to zero .
I need to Focus myself on the control I want to be focued when application runs.
I'm stucked with this for more than 6-7 hours, Removed all the resource file Entries of TabIndex and set all of them again. (Didnot work).
Tried to Set focus on tha control in Form's Load event (Didnot work too).
Also Saw the Property in Form's Load even that if that control can be focused using Control.CanFocus (Always Returns false).
Please tell me something about this Bull S***
Its a pain in A** for me at this time.
I'll be really thankful to you for your help.
Best Regards,
Rizwan.
|
|
|
|