|
The problem is that you are not creating an instance of the menuitems. Use an ArrayList to store each new menu item. Also, it's best to add the menuitems in your method "AddItem_Click". So modify the AddItem_Click as follows:
<br />
ArrayList arr = new ArrayList(); <br />
private void AddItem_Click(object sender, System.EventArgs e)<br />
{<br />
this.ListItemCount++;<br />
this.ListBox.Items.Add( "item" + ListItemCount.ToString() );<br />
<br />
MenuItem mi = new MenuItem("item"+ListItemCount.ToString());<br />
arr.Add(mi);<br />
this.ListItems.MenuItems.Add(mi);<br />
}<br />
>/code>
|
|
|
|
|
I would like to send a string from one windows application to another.
Would anyone know how to do this using the SendMessage WinAPI function?
My attempts have failed so far.
|
|
|
|
|
Don't do it using the SendMessage method; that is for window messages.
Do you have access to the source code of both applications? If so, use .NET remoting or web services to pass a string.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Thank you for the response.
Yes I have the source code for both apps. At present, the apps are just for test purposes. Trying to determine the best method for application communication.
I've had a quick look at remoting. I was unable to figure out how a remoting object is able to communicate / attach itself to an application?
The information I am trying to send across is to inform an allow the application to perform some work.
|
|
|
|
|
I'm programming a C# application and I have one thread making one operation.
This threads is called by a method.
When I use this method from the current Application, by means of a Button it works properly. But if I call this method from another thread the method works only if this thread still alive.
I guess that in the 1st case the threads parent is the application thread but in the second case the parent is the other thread.
I can see it because I generate a Form with this method/thread and it disapears suddenly when I use a thread for call it.
Some help??
PD: Sorry for my English
|
|
|
|
|
You'd need to state the problem more clearly.
From your description, it looks like you're trying to launch a Form from within the thread. Did you use Form.Show or Form.ShowDialog ? I suspect you used Form.Show , that's the reason it worked when invoked from a button. A modeless dialog requires a message pump[^] to be running on the calling thread. When you create one with a button click, it'll use that threads' message pump (which is what processed your message). When you create one in your own thread, you have to run the message pump yourself, like this
Form form = new Form();
Application.Run(form);
in your thread.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I'm sorry but this does not works.
I cannot use the method ShowDialog() because I need the Form behaviour and use Aplication.Run(form1) throws a Exception.
...
Maybe I missunderstand your directions, but I think that there will be another solution using some thread properties.
Thanks for your advice.
|
|
|
|
|
Hi,
Is it possible in datagrid to assign a hidden tag for each row identify the AutoNumber ID from the database instead of displaying it as a column?
Best Regards,
Jassim Rahma
|
|
|
|
|
You can change that cell to be not visible in the DataItemBound method for your datagrid. Something like this....
<br />
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{<br />
e.Item.Cells[0].Visible = false;<br />
}<br />
Steve Maier, MCSD MCAD
|
|
|
|
|
I'm no longer using DataGrid because it was lacking so many features I needed such as setting row/cell keys conveniently. I'm currently using iGrid.NET from www.10tec.com. I'm very happy with it so far. Using this grid, I can easily set the row key like this: iGrid.Rows[row].Key = rowKey;
Glenn
|
|
|
|
|
Thanks for your reply..
what about data resfresh?
because using datagrid I have to clear the dataset and fill it again which takes time specially on a network.
Best Regards,
Jassim Rahma
|
|
|
|
|
Hi Jassim,
Unless I have to refresh the entire grid, I only update individual rows/cells based on what needs to be refreshed - and obviously that's faster than repopulating the dataset and refreshing the grid (iGrid is very fast, by the way). I use grids in unbound mode and I manually populate the grid and maintain/refresh the grid myself. I like working that way better but there might be other ways to populate data in iGrid. I’m not too familiar with that. You may want to send an email to support@10tec.com. They are good at responding emails.
Glenn
|
|
|
|
|
I have a GUI with multiple TextBox and ComboBox controls. These controls are bound to a datasource and are update via the CurrencyManager. How can I detect when a user has started to modify the text in one of the controls?
If I advance to the next record I can check the status of the CurrencyManger and determine is the previous row has changed. I want to be able to detect that the row is changing before the user has advanced (or retreated) rows.
Currently I am thinking that I will need to enable the TextChanged event for each control (controls are created dynamically) and use that to determine if an edit has happend and then disable the event when the user advanced to the next row, and then reenable after the controls have populated with data.
Is that a good way?
Thanks.
www.lovethosetrains.com
|
|
|
|
|
I have a class library which prints a report directly from reporting services. I have a few Console.WriteLine statements. When i insert this library in my main application and use it i see the Console.WriteLine info written in the debug window of the .NET IDE. What i would like is to use this info in my own application. Is there a way to print this information somewhere in let's say a textbox of my main application ?
|
|
|
|
|
If you use System.Diagnostics.Trace.WriteLine (you can't use formating [with '{0}'] directly with this) instead of System.Console.WriteLine , you can tell your App to get the Trace Data with
System.Diagnostics.TextWriterTraceListener traceListener = new System.Diagnostics.TextWriterTraceListener( {a stream to receive the Trace Messages} );
I don't know if you can also redirect the System.Console.Out Stream.
Greets
Roland
Wenn der Computer wirklich alles kann, dann kann er mich mal kreuzweise.
(Manfred Schmidt)
Follow your Euro notes in their tracks
|
|
|
|
|
You can always redirect console output to your own stream, provided you launch the process.
You can write a tiny bootstrapping application that launches your main application after redirecting standard output and also captures console output. Something like
class BootStrapper
{
StreamReader reader;
public static void Launch()
{
ProcessStartInfo info = new ProcessStartInfo();
info.RedirectStandardOutput = true;
...
Process p = Process.Start(info);
reader = p.StandardOutput;
new Thread(new ThreadStart(ConsoleReader)).Start();
}
private void ConsoleReader()
{
string line = null;
while ((line = Process.GetCurrentProcess().StandardOutput.ReadLine()) != null)
{
}
}
}
Or you can replace calls to Console.WriteLine with Trace.WriteLine and use the method that the other poster suggested.
Hope this helps.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
yeah this helped for sure thanks a lot to both of you !
|
|
|
|
|
In Visual Studio 2003, when you add an xml comment (with '///'), the IDE helps you with the intellisense to remember the tag names. As NDoc adds some tags (<exclude /> as an examle), it would be nice to have support for this tags in the intellisense.
Is it possible to extend/adapt the list of tags and its structure (the schema), and how? I've searched in the folder of the ide for a schema file or something like this, but was not successfull.
Thanks
Roland
Wenn der Computer wirklich alles kann, dann kann er mich mal kreuzweise.
(Manfred Schmidt)
Follow your Euro notes in their tracks
|
|
|
|
|
how a tcp server running on given uri like "soap:tcp://localhost:8080/MyReceiver" will return wsdl. In normal web service case which runs on http returns wsdl by simply appending '?wsdl' in url, but I am confused how a tcp server will do the same.
plzzzzzzzzz reply !!
thanks in advance
iffi
|
|
|
|
|
You an use the url with wsdl query string
as
http://localhost/myservice.......?wsdl
Shahzad Raja
|
|
|
|
|
Thanks raja jee..
But i have tried the way u suggested...
http://localhost/myservice.......?wsdl
but its not working cz myservice is running on TCP over SOAP
soap:tcp://localhost/myservice.......?wsdl
I dont think so we can access tcp service using http request..
looking forward
|
|
|
|
|
Are there any issues with connecting to the ORACLE 10g database through C# .Net? I will be using OracleClient namasapce for the same. Let me know if there are any issues with that too.
The OracleClient namespace is available only when we install Oracle client components in the development environment. Do we need the oracle client components to be installed on the production machine as well when we deploay the application or the corresponding dll are enough?
Thanks in advance. Let me know this as soon as possible, because I have to select the backend for my project.
|
|
|
|
|
Hi
I have made window service installer setup
In this program i am using the follwing code inside OnStart
Process.Start(@"c:\sanjeev\farm.exe");
here i have include the whole hard coded path but i do not want to give there the path . Path should be taken from another set up file which is given below
I have made another installer for my Project ( product) which includes help file ,its self product.
THe second setup of my product works file . but when i install the first one setup windows service installer i need to know the path of second one exe file i.e the path of farm.exe
can anybody tell me how can i retrive the path of my product 's exe bec windows installer should automatically know the path of farm.exe file
can anybody tell me
is there any method to integrate my windows service installer and my product installer
Everything is possible
|
|
|
|
|
Hi,
I need to know how to capture the killing of a C# windows application from task manager.Does any event of the application can be trapped to know this.
Please let me know your suggestions
Thanks
|
|
|
|
|
Task Manager first tries to shut your application down normally. This is no different than someone clicking the close button of your form. If your app doesn't respond, you'll get the "End Task" box. This is where the application isn't shutdown, but is just stopped and removed from memory, uncleanly.
If your application is the one being shut down, the only notification your going to get is the Closing event. If your application is hung, you'll never see the event.
If your trying to get notification of another app being shutdown, you can use the Process class WaitForExit method. I'm not saying that this will be a sure fire method for getting a notification, but it's a start.
But, there is no event that says another application is being terminated from TaskManager.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|