|
hi all,
How can i create a tree which allow me to drag the tree childs and drop it in to the textbox.Is it possible? can any one help me to do this?
ayyp
|
|
|
|
|
You should ask in the ASP.NET forum. It can be done, it involves a lot of javascript, and no real C# code.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hi all,
I am having a problem with my report. i have a dataset which gets fill while it is in run mode. I wanna create a report out of this. plz help me.
Regards
Ruwandi
rkherath
|
|
|
|
|
You question is too vague to give a meaningful answer.
What problems in particular are you having with creating a report? Have you looked at Crystal Reports or any of the many reporting SDKs on the web?
|
|
|
|
|
Hi... I'm writing my own panel class which of cause inherited from Panel. And the code here works just fine BUT if I make a property where the return type to fx int, it fails. And the exception I get is useless. Is this something with TypeConverters?
public class TestCell
{
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
"Width",
typeof(double),
typeof(TestCell),
new FrameworkPropertyMetadata(
0d,
FrameworkPropertyMetadataOptions.None));
public static void SetWidth(UIElement element, double value)
{
element.SetValue(WidthProperty, value);
}
public static double GetWidth(UIElement element)
{
return (double)element.GetValue(WidthProperty);
}
}
public class TestPanel : Panel
{
protected override Size MeasureOverride(Size availableSize)
{
Size childSize = availableSize;
foreach (UIElement child in InternalChildren)
{
child.Measure(childSize);
}
return availableSize;
}
protected override Size ArrangeOverride(Size finalSize)
{
foreach (UIElement child in InternalChildren)
{
double x = TestCell.GetWidth(child);
double y = 50;
child.Arrange(new Rect(new Point(x, y), child.DesiredSize));
}
return finalSize;
}
}
<Window x:Class="WPFApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="clr-namespace:MyAssembly;assembly=MyAssembly"
Title="Window1" Height="300" Width="300">
<mc:TestPanel>
<Button Width="100" Height="100"/>
</mc:TestPanel>
</Window>
-- modified at 8:59 Monday 16th April, 2007
Best regards
Lasse Espeholt
|
|
|
|
|
I am boring with instantly going inside Add/Remove Program, selecting my uncomplete program and removing. When making Setup file, I can't find any item mentioning Uninstall in Program Files .
Someone help me solving my problem. How should I do ?
Thanks in advance
It seem to be a solution or an answer.
|
|
|
|
|
There are installers that create an uninstall exe, but msi's do not, AFAIK.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
What are some installers you mentioned ? Thanks
It seem to be a solution or an answer.
|
|
|
|
|
Try to change the current version of your exe. Then you can set the option "remove previous versions" to true.
The system will automatically replace your previous application
My small attempt...
|
|
|
|
|
How do I change my current version of exe ?
It seem to be a solution or an answer.
|
|
|
|
|
you can it will be 1.0.0
you can change it to 1.0.1 or more
My small attempt...
|
|
|
|
|
Is it possible to for one exe(.net) to contain another exe(not .net created)?
The purpose of the parent .net exe is to check a condition and then execute the exe contained within it.
I know the .net exe can call another exe which is present separatley in the system. but is it possible for the .net executable to encapsulate the other exe file such that it doen't need it separately . Any help would be apppreciated .
Thanks for u'r time
|
|
|
|
|
It could contain it as a resource, but I'm not sure you could run it without writing it to disc first.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
thanks , but can u give me an example for using as resource or anyother article which i can learn abt using the exe as a resource
|
|
|
|
|
No, I've nevr done it, and I can't imagine wanting to. But, you can add anything as an embedded resource.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=75 here you go
Best regards
Lasse Espeholt
|
|
|
|
|
Thank You very much espeholt_jr.
|
|
|
|
|
hi,
I am using richtextbox control and in button click this is the code
if (richTextBox1.CanUndo == true)
{
richTextBox1.Undo();
richTextBox1.ClearUndo();
}
This code clearing the entire text in richtextbox in single click.
But I want it should undo chratcer by chracter.
pls help me
with regards
prasad
|
|
|
|
|
Search the articles for "undo"; there are some here on CP that cover the support of undo/redo actions.
"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
|
|
|
|
|
Hey everyone,
I'm having a hard time getting my program to wait for an acknowledgment from a piece of hardware. An eventhandler in my program sends off a message to the box, and resends until an ack is received. What is the best way to handle this? I'm trying to use threads, which I am unexperienced with. Is there an issue I should be aware of when trying to do this within an eventhandler?
Thanks so much
|
|
|
|
|
Hi,
the user interface is handled by the "UI thread"; it looses good responsiveness
as soon as your UI thread is busy for more than say 100 milliseconds, and
it is completely ruined when the thread is busy for several seconds.
So if your hardware communication typically needs longer than that, you should
use a separate thread for it. Best would be to create a class that models
your hardware and contains all necessary threading stuff, so it remains hidden
from the main app. Of course, using one or more additional threads requires
an asyncrhonous API, i.e. one that splits operations in two parts:
order something (without waiting for it),
then collect results (which may be null since not yet finished).
Try using only one additional thread for your piece of hardware, since having
multiple threads interact with it would complicate matters.
You may want to implement a mutex that prevents your main app from ordering
a second operation before the first operation has finished.
Hope this helps.
|
|
|
|
|
The method to dealing with this problem efficiently is to have a separate thread that waits for responses from your device. When this thread receives the response, its validity can be confirmed, then you can send the data up to the UI (if indeed that is where the data is to go). In the UI code you need to do the invoke on the method that is updating the control.
The method I used in the past to block execution was to put the send command in a separate thread which reset a manual reset event, then make the call, and wait for the receive thread to signal. But this wait was not indefinite. I always put a timeout on the wait so that other sends would not be delayed indefinitely (the case where: what happens when the device is switched off?). In the receive thread, after the reply has been validated, the manual reset event can be signalled (set).
Using the method described above, allows the UI to continue while the threads are waiting for their turn in action.
Phil
|
|
|
|
|
I have an application that is reading thousands of rows form an access database running calculations then updating the data. I'm using an Async. Design pattern that I'd found on MSDN and am getting my butt handed to me.
public void StartRecalculation() {<br />
try {<br />
FillArrayList();<br />
for ( int num = 0; num < m_Manifest.Count; num++ ) {<br />
Guid taskId = Guid.NewGuid();<br />
<br />
this.CalculateStartAsync( Int32.Parse( m_Manifest[ num ].ToString() ), taskId );<br />
}
}
catch ( Exception ex ) {<br />
AddToErrorReport( ex.ToString() );<br />
}
}
<br />
public void CalculateStartAsync( int _ticket, object taskId ) {<br />
AsyncOperation asyncOp = AsyncOperationManager.CreateOperation( taskId );<br />
<br />
lock ( userStateToLifetime.SyncRoot ) {<br />
if ( userStateToLifetime.Contains( taskId ) ) {<br />
throw new ArgumentException( "Task ID parameter must be unique", "taskId" ); <br />
}
<br />
userStateToLifetime[ taskId ] = asyncOp;<br />
}
<br />
WorkerEventHandler workerDelegate = new WorkerEventHandler( CalculateWorker );<br />
workerDelegate.BeginInvoke( _ticket, asyncOp, null, null );<br />
}
My question is when creating the WorkerEventHandler ie..
WorkerEventHandler workerDelegate = new WorkerEventHandler( CalculateWorker );
And then calling the BeginInvoke
workerDelegate.BeginInvoke( _ticket, asyncOp, null, null );
Is this creating a new instance of the CalculateWorker Method and other referenced methods?
Will I need to isolate my tableAdapters to each method and create new each time or will I be able to us a global Dataset to store and manipulate the inforamtion.
I'm having trouble completing anything within my database. I'm getting random rows not found and outOfIndex exceptions. If anyone has any advice on the topic, please help.
thanks.
I'm listening but I only speak GEEK.
|
|
|
|
|
Hi Arejay,
I am not a db specialist at all, but this may help:
your code starts a number of threads each executing the "CalculateWorker" method.
BTW: methods dont get instantiated, they just get executed, using the local context
(e.g. the stack belonging to the executing thread).
So the app has several threads executing the same code, if that code refers
to global data (all your class members) you may get concurrency problems.
If for instance you create and use some object (maybe a table adapter) and
suddenly that object gets manipulated by multiple threads, anything can happen.
Rather than using such shared data (and trying to add all necessary locks), I
would advise to give each thread its own data, i.e. instantiate a "job" object
for each thread you create (better yet, create the thread inside the job object).
Hope this helps.
|
|
|
|
|
Thank you!
So... I've created a worker class and I'm creating multiple instances of the worker. Within the worker class I create an asyn thread using the BeginInvoke. Now I need update the calling form.
public delegate void CalculationCompletedEventHandler( object sender, CalculationCompletedEventArgs e );<br />
In the Worker class:
<br />
public class Worker : Component {<br />
public event CalculationCompletedEventHandler CalculationCompleted;<br />
<br />
private void doCalculationCompleted( object operationState ){<br />
CalculationCompletedEventArgs e = operationState as CalculationCompletedEventArgs;<br />
OnCalculationCompleted( e );<br />
}<br />
<br />
protected void OnCalculationCompleted( CalculationCompletedEventArgs e ){<br />
if ( CalculationCompleted != null ) {<br />
CalculationCompleted( this, e );<br />
}<br />
}
On the form:
internal void OnUpdateProgress( object sender, CalculationCompletedEventArgs e ){<br />
if ( this.InvokeRequired ){<br />
this.Invoke( doProgressUpdate, new object[] { sender, e } );<br />
}else{<br />
lock ( this ){<br />
} <br />
}<br />
}<br />
<br />
Worker w = new Worker(id);<br />
w.CalculationCompleted += OnUpdateProgress;
In the above is the doCalculationCompleted method needed in the Worker Class?
I'll update my code and let you know how it went.
Thanks again.
I'm listening but I only speak GEEK.
|
|
|
|