|
I don't know how to do it using __doPostBack, but I imagine it would look something like this:
window.opener.location.reload();
You would probably get better results by asking this question in the Java forum though.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Hi All,
I am creating windows app, with MVP architecture.I added a textbox and button to the window.xaml, so that my intention is to browse a folder on button click and display the path in the textbox.
If I select MyDocuments in browse click, then the entire path (C:\\Documentsandsettings\....\MyDocuments) should be displayed in the textbox.
I am new to MVP and as of now
1 . window.xaml with textbox and button
2. presenter class (windowpresenter.cs)
3. Interface class (Iwindow.cs) are created .
But, I am unaware of how to link these controls and how to use publish and subscribe these controls.
Please kindly help me in doing this.
Thank You,
Ramm
|
|
|
|
|
Hi To all
I`m very new to the programming and got stuck.
So i`ve been trying to write a program using Windows Form which include several different panels on. User can choose between which one is visible.
on each form there are few pictureboxes and my problem is .....
when you swich between them in the runtime it`s not smooth enough user can see loadning frames of these picture boxes for few miliseconds this is really annoying.
Is there any easy way of loading it in the background and show it after its ready or something ??? I started reading about threads etc but at the moment its quite difficult, i will be gratefull if someone could explain it with an example
Thanks in advance
Dims
|
|
|
|
|
You could call pictureBox1.SuspendLayout(); , load your image into the PictureBox, then call pictureBox1.ResumeLayout(true); to update the layout.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
right i`ll try that but i forgot to tell you that on the form is background 800x600 bitmap so maybe that is the reason that is so slow.
|
|
|
|
|
It doesn't really matter, except that you might want to call SuspendLayout and ResumeLayout for the form as well. That might speed things up slightly, but I've not tested it.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It`s not working for me, what i`ve noticed is that all the panel as the user switches between do same thing whether there are only labels or pictureBoxes
so i`m assuming that there`s the problem with bitmap on the background of the form.
panels they are all set up as transparent.
any ideas??
|
|
|
|
|
Hi,
if your app is slow, try and figure out why and fix it. Are your images way too large and getting downscaled all the time? are you using some fancy transparancy stuff?
And did you look into double-buffering? you might try and set DoubleBuffered true. That does not really solve performance problems, it does hide some of its visual effects though.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hi everybody.
I have an C# desktop application, it support multiple instances.
but in my case, my application get 10-15 sec to load and if in between second instance get started, it will crash.
So i wish multiple instance application but even if there will be successive two double click to start application, second ,third instance should wait a while..
I have tried mutex but i have no detail idea of mutex.
Pls give me a way to do it
Thanks in advance.
|
|
|
|
|
Just a quick point - it'd be better to avoid crashes when multiple instances start by addressing that rather than delaying start up. Why does it crash?
You may be able to get a more granular critical section that way. Failing that then a Mutex probably is the way to go.
Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob ,
Thanks for reply/
I am not able to find a reason for crash but it may be reading/writing file at a same time.
Any idea about mutex.WaitOne(...)
Thanks
|
|
|
|
|
Anybody know where I can find a decent Class Generator that will generate classes for me based on Access 2007/2003 tables? Preferrably Access 2007.
|
|
|
|
|
Such auto-generated classes would likely be useless. There is no substitute for doing it yourself.
|
|
|
|
|
Well I've actually downloaded a class generator that works with Access 2003 and it works perfectly, generated all the classes for me together with methods for adding, updating etc.
|
|
|
|
|
Can you state where you downloaded the class generator or even just it's name? I too am looking for this kind of product.
|
|
|
|
|
|
|
Hi all,
I have a form with datagridview , some datetime pickers and some textboxes. I have modified the code found on this webpage to draw the rows and columns of the datagrid
http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/dc9d3acf-ccf8-457f-ba31-ef09fb357aee/ on the print page . The datagrid is getting drawn on the top of the page. I want to display the textbox contents and datetimepicker contents before the datagrid. Can any1 let me know how to draw the datagrid at the middle of the page with reference to the code in the link.. Thanks,
|
|
|
|
|
There are several code snippets on that link and you do not say which you are trying to use.
However, the grid will be being drawn at coordinates specified somewhere in the code, most probably using DrawRectangle() although that is not certain.
DrawRectangle() most commonly uses a Point structure or a Rectangle structure. So you need to look for a Point parameter that is set to Point(0, 0) , if the grid is at top left, or Point(?, 0) , if it is just somewhere along the top. The same would apply to the first parameter of a Rectangle() if that is what is used.
Find the one that you think draws the grid and experiment with the numbers e.g. try Point(20, 20), run it and if the grid is in a different place then you have found the correct parameter, if not, put it back to what it was before and try another one till you succeed.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have following code in my start button which starts the process.
void BtnStartClick(object sender, EventArgs e)
{
btnStart.Enabled=pdfStopped=xmlStopped=false;
btnStop.Enabled=true;
ThreadPool.QueueUserWorkItem(new WaitCallback(Startup));
}
void Startup(object s)
{
try
{
Start();
timGeneral.Enabled=true;
timGeneral.Start();
}
catch(Exception){}
}
void Start()
{
pdfThread=new Thread(new ThreadStart(pdfDownloadStart));
pdfThread.IsBackground=true;
pdfThread.Start();
xmlThread=new Thread(new ThreadStart(startXMLDownload));
xmlThread.IsBackground=true;
xmlThread.Start();
pdfStThread = new Thread(new ThreadStart(createPdfFileStructure));
pdfStThread.IsBackground = true;
pdfStThread.Start();
}
well i am trying to stop all these running threads in stop button, but i could not achieve it
how can i stop all threads?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
try to avoid using Abort to stop the thread. Use flag to abort the thread.
I got a lot of problem using Abort.
while(isThreadRunning)
{
...
}
to stop it, set isThreadRunning = false;
|
|
|
|
|
Note: you must declare isThreadRunning as volatile, or it will be optimised out...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
well, my friend, if u see i have used
ThreadPool.QueueUserItem(...);
How should i get rid of this to stop all threads.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
You must implement the code, that I sent, in these methods:
pdfDownloadStart
startXMLDownload
Then set isThreadRunning=false to end the thread.
|
|
|
|
|
well, i think u guys did not understand me correctly, bellow is the complete code only for "pdfDownloadStart"
void StartStructureTimer(int time)
{
timStructure=new System.Threading.Timer(new TimerCallback(TimerStructureJob));
timStructure.Change(time,0);
}
void TimerStructureJob(object state)
{
System.Threading.Timer tm=state as System.Threading.Timer;
tm.Dispose();
pdfDownloadStart();
}
void pdfDownloadStart()
{
try
{
signalMessage(string.Format("Searching Server {0} for newly added Files",fdo.FtpServer));
dtList=p.getPdfNotDownloaded();
if (dtList.Rows.Count>0)
{
signalMessage(string.Format("{0} Files Found for Download",dtList.Rows.Count));
fdo.FilesToDownloadList=dtList;
fdo.LocalDownloadDirectory=TempDirectory;
Thread tPdf=new Thread(new ThreadStart(downloadFile));
tPdf.Start();
tPdf.Join();
if (!fdo.DownloadStatus)
{
if (timDownload!=null)
timDownload.Dispose();
signalMessage("Download Failed\r\nretrying in 60 second");
StartTimer(36000);
}
else if (fdo.DownloadStatus)
{
if (timDownload!=null)
timDownload.Dispose();
signalMessage("All Files Downloaded Successfully\r\nretrying in 60 second");
StartTimer(36000);
return;
}
else
StartTimer(36000);
}
else
{
signalMessage("No Files Found\r\nretrying in 60 second");
StartTimer(36000);
}
}
catch(Exception ex)
{
if (!pdfStopped)
{
signalMessage("Failed downloading Files from Remote Server "+ex.Message+"\r\nretrying in 60 second");
StartTimer(36000);
}
else
signalMessage("Failed downloading Files from Remote Server "+ex.Message);
}
}
all methods which runs on those thread has the same functionality. if u see after "60 second" process runs agains.
if i abort or stop the thread still the job runs after 60 seconds.
if u see closly another thread is running to download the files, well i want to stop all these threads, if i use bool value like that still the scheduled process runs.
how can i stop all these threads from calling thread to end?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|