|
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.
|
|
|
|
|
I once had the same problem. I had to put the focus on the control I wanted with control.BringToFront();
I don't know why the TabIndex sometimes don't work with VS2005, but I didn't found the error. After I reinstalled the computer (and VS2005) it worked fine.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Hmm, Its impossible to reinstall all the things again. But yes you are so true this is some bug with VS 2005 coz my friends also complained me about this when i discussed my problem with him.
Anyways there are 2 possibilities:
1) I Compile it at some other computer.
2) I use the method you used control.BringToFront();
Can I put control.BringToFront(); in Form's Load Event?
Can you explain the code:
Should I use this:
control.BringToFront();
control.Focus();
in Form's Load Event?
Thanks a lot for your reply,
Best Regards,
Rizwan
|
|
|
|
|
tried this: (Didnot work)
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.BringToFront();<br />
}
Nor this:
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.BringToFront();<br />
rtfSend.Focus();<br />
}
Nor this One:
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.Focus();<br />
rtfSend.BringToFront();<br />
rtfSend.Focus();<br />
}
Any Help??
Thanks a lot
Best Regards,
Rizwan
|
|
|
|
|
That's strange, but I don't get the same error now, so I can't test it.
Sorry,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Ahhhh! Ok, Thanks.
But are you sure Windows and Visual Studio Reinstallation can fix this problem
I think this configuration may only reside in Resource files which i refined clearly but not working :->
Thanks a lot,
Regards,
Rizwan
|
|
|
|
|
dotnetdev83 wrote: But are you sure Windows and Visual Studio Reinstallation can fix this problem
No sorry I'm not sure. For me it worked, but I don't know if our problems have the same cause.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
It might be a good idea to look at the control that IS getting focus when you load your form.
Is it a panel? I've had to set the TabStop property to false on a panel before, even though it had a high tab index.
|
|
|
|
|
Yes,
I have tried all the things, I set all the panels and all oher controls' TabStop property to false.
But again the same proble.
When I run the application, The focus of the control must be at the control whose TabIndex is 0 rather it focuses control with TabIndex 2.
When I try check CanFocus property of Controls with TabIndex 0 in Form's Load it returns false.
I want to know the reason what's the reason behind "Control.CanFocus is always false". How does it evaluate this that it cannot be focused. If i know this then may be we can solve the problem.
Thanks alot,
Best Regards,
Rizwan Ahmed.
|
|
|
|
|
hi all i have this pro on hand now.. i have downloaded some sample database applications from the internet..however when i want to debug it i gives me the error--An unhandled exception of type "system.Data.OleDb.OledbException" occurred in system.data.dll
does this errors occur due to where the dB file is located..is it correct? can someone out there help will this pro? and maybe guide me to correcting it ..thanks in advance..
an extract on of codes where the problem is highlighted is below:the pro is bold...thanks in advance
private void fclsMain_Load(object sender, System.EventArgs e)
{
m_cnADONewConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\contacts.mdb";
m_daDataAdapter =
new OleDbDataAdapter("Select * From Contacts",m_cnADONewConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtContacts);
this.ShowCurrentRecord();
|
|
|
|
|
You need
cnADONewConnection.Open();
before
m_daDataAdapter.Fill(m_dtContacts);
|
|
|
|
|
DataAdapter handles the open and close connection in the Fill method
only two letters away from being an asset
|
|
|
|
|
What is the message in the exception? This will tell you (and us) more of what is going on.
only two letters away from being an asset
|
|
|
|