|
The popup is a new form. The main thread processes the main form. The second form (popup) is managed by a different thread.
|
|
|
|
|
I was able to find a solution.
I was able to remove the dependency on the ThreadPool by using the modeless Show() instead of modal ShowDialog(). This allowed my program to continue to process while the popup was still showing. This handled the none maximized screens.
For the maximized screens I overrode the 'ShowWithoutActivation' property of the popup form.
All this of course with TopMost set to true.
|
|
|
|
|
Hrm. Actually it doesnt seem to work everytime. It works in both full screen mode and normal mode. Then it will stop working. Then I resize a screen or something and it works again....
|
|
|
|
|
It appears to be working on both full screen and normal screen until I close one of the popups(forms). Then the very next one will take focus away. After that it will begin working properly until I close one of the popups.
|
|
|
|
|
Hey guys
I have an MDI form that has a panel across the top for displaying business information. Whenever any of this panel is updated..I get this nasty bleeding effect where i can see through the borders of the labels etc. Has anyone ever seen anything like this?
|
|
|
|
|
Not seen this but have you tried calling its Invalidate() method to force a redraw?
If it's the panel's child controls that are the problem call Invalidate(true)
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hi Guys,
i'm trying to sort the result from a datatable based on month and year.
getMonth below arranges d group header how i want. But the code puts on item per group. The prob, groups are repeating. Ex: May, 2008 repeats like five times but with diff items under it.
private string getMonth(string theDate)<br />
{<br />
string theMonth = theDate.Substring(0, theDate.IndexOf("/"));<br />
string theYear = theDate.Substring(theDate.LastIndexOf("/") + 1, 4);<br />
<br />
return (MonthName)int.Parse(theMonth) + ", " + theYear;<br />
}
Then i try to add the items, first into an array, then a ListViewItem
<br />
for (i = 0; i < dtAcct.Rows.Count; i++)<br />
{<br />
DataRow drow = dtAcct.Rows[i];<br />
<br />
ListViewGroup lvg = new ListViewGroup(getMonth(drow[0].ToString()));<br />
lvAccount.Groups.Add(lvg);<br />
<br />
string[] items = { Warehouse.DateMender(DateTime.Parse(drow[0].ToString())),<br />
drow[1].ToString(),
drow[2].ToString(),
setTransDetails(Int32.Parse(drow[3].ToString()), drow[4].ToString()) };<br />
<br />
ListViewItem lvi = new ListViewItem(items, lvg);<br />
lvAccount.Items.Add(lvi);<br />
}<br />
pls, can anyone help resolve this for me. Thanx a million!
He who goes for revenge must first dig two graves.
|
|
|
|
|
listen, do you filter/sort sql data on c#?
my advice is DON´T DO IT.
Create both read and write store procedures in sql and trigger them with c# events (like form_load or button_click or whatever).
It´s easier!!!
|
|
|
|
|
I'm trying to figure out the correct way of compiling the final version of a console application for other people to use.
I've done the "Build project" way, but then the user has to copy over all of the DLL files in my "bin" directory in order to get it to work. This way isn't very professional.
I've also done the "publish project" option, however when I publish it, I get 2 "application manifest" files (1 names "MyProject_1_0_0_0" and another simply names "MyProject"), a directory containing the DLL's (usually called "MyProject_1_0_0_0"), and a setup.exe file. I'm unsure of which ones to send over, so I just send them all over. This way isn't very professional either.
So, what's the correct way to compile my final version of a console application before handing it off to a user?
Thanks.
-Goalie35
|
|
|
|
|
Goalie35 wrote: So, what's the correct way to compile my final version of a console application before handing it off to a user?
You dont have to publish anything (I think thats to do with click once). The content in the bin\Release directory should be sufficient
|
|
|
|
|
Visual Studio .NET allows you to specify files to be included in a deployment project (whatever your application might be). See details[^].
SkyWalker
|
|
|
|
|
I have to create a multithread program. It must control a pool of thread. How do I do this in C#?
The idea is: Reading a properties file, the program will know what kind of thead It will start. Each thread will take care about one subject. Each thread will receive a parameter indicating how many thread will have in its pool.
The MainThread will control the pool of thread, when it needs to process some UDP message will request a free thread in the pool. Will pass all of the information (data) to the thread and order to run. When the thread finishs its job will be in suspend mode waiting for next job.
I had develop this kind of program in Delphi and in Java with success! But in C# I did not find any way to do this.
Thanks.
+------+ +----------+
| | |Thread-UDP|-------> +------+
| .EXE |-----> |LISTENER | | T2 |
| | +----+-----+ +------+
+------+ | \
| \
\/ \
+-------+ +--------+
| T1 | | T3 +
+-------+ +--------+
|
|
|
|
|
There are a lot of tutorials on the topic.
You could start very well here[^].
SkyWalker
|
|
|
|
|
This [^] might help.
Google it up, there's a million more!
He who goes for revenge must first dig two graves.
|
|
|
|
|
This [^] might help.
Or, this[^]
Google it up, there's a million more!
He who goes for revenge must first dig two graves.
|
|
|
|
|
A while back I wrote a class named SynchronisedQueue[^] for parallel processing of Mandelbrot graphics.
The main thread could use it to send the jobs to the threads by simply adding it to the queue. The threads would periodically try to get something from the queue while they are idle.
The class for a thread could be something like:
public class WorkerThread {
public volatile bool Contine;
private SynchronisedQueue<Job> _jobs;
public WorkerThread(SynchronisedQueue<Job> jobs) {
Contine = true;
_jobs = jobs;
}
public void Run() {
while (Continue) {
Job job;
if (jobs.TryDequeue(out job)) {
} else {
Thread.Sleep(100);
}
}
}
}
The main thread creates a queue, then creates the objects for the worker threads and sends the queue along to the constructor.
If you need to send a result back from the worker thread to the main thread, you add another queue for the results. When the thread is done it just adds a result to the queue, and you have a timer in the main thread to look for results in the queue.
The code for dispatching the jobs gets really simple. There is no requesting of threads and handling the situation of waiting for a free thread, just throw the jobs in the queue, and the first thread that gets free grabs it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
hi
i am using gridview control and in gridview control i have checkbox. when i click on linkbutton checkall then i want that check all checkbox and if i click on uncheckall then i wnat that uncheck all checkbox. how can i do using javascript? plz help?
thanks in advance.
|
|
|
|
|
Try the web forum.
But here is half the answer. You figure out what 'r' is
function SelectAll(sender)
{
var checked = sender.checked;
var ll = document.getElementsByName("r");
for (var i = 0; i < ll.length; i++)
{
ll[i].checked = checked;
}
}
|
|
|
|
|
I am trying to pass params from one function to another, but it errors out when passing the received args onto the other function! Scratched my head over this one and googled and can't find a solution!
Any ideas?
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
public void WriteFormat(string format, params object[] args)
{
if (sb != null) sb.AppendFormat(format, args);
if (writer != null) writer.Write(string.Format(format), args);
}
|
|
|
|
|
FruitBatInShades wrote: if (writer != null) writer.Write(string.Format(format), args);
You have a closing parenthesis in the wrong place in the above line.
|
|
|
|
|
Hi,
I missed that one; a rare occasion where a syntactic mistake is not caught by the compiler, due
to the existence of overloads for both methods...
However if writer is say a TextWriter, the whole string.Format invocation is redundant, a simple
writer.Write(format, args) would have been sufficient.
|
|
|
|
|
Luc Pattyn wrote: a simple
writer.Write(format, args) would have been sufficient.
indeed it would.
|
|
|
|
|
That was it, well spotted! many Thanks
All working now! I just wanted to create library routines that render html to a StringBuilder or a HtmlTextWriter for duplicate rendering in ServerControls. Works out really well
|
|
|
|
|
Did you look at the value of format when the problem occurred?
Did you check args had a sufficient number of elements for it?
If so, why didn't you tell us their values?
Did you check at what exact line the exception occurs?
- an exception holds line information, you get to see it when you call Exception.ToString()
(but not when using Exception.Message).
- any half-decent IDE can display line numbers; to turn this on in Visual Studio, go to menu
Tools/Options/TextEditor/AllLanguages
|
|
|
|