|
Hi All,
I make the reports in my program using crystal report, I design it using the stored procedure the problem is in the procedure which have if condition or execute statement the fields does not appear in the design of the crystal report.
merwa
|
|
|
|
|
I have an application. it has two forms. first form - mainForm is big and some images are loading into mainForm. second form - loginForm should be showed while mainForm is invisible is loading.
loginForm has a label that has "Loading...".
all is working but this label on the loginForm is not visible few seconds and I guess apllication is not response, but then all is ok. label is visible and formLogin to. after loading of maiForm is complete , loginForm should be hide..
can I fix waiting of showing of the label on the formLogin? is there somethig like "Application.ProcessMessagess" in Delphi?
thanx!
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
Application.DoEvents.
Getting your init to happen on another thread, is even better.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Thanx!
I tryed - but it doesnt work
it is my loginForm
public partial class frmLoading : Form
{
private int pointCount = 0;
private int iterationsCount = 0;
public frmLoading()
{
InitializeComponent();
}
private void frmLoading_Load(object sender, EventArgs e)
{
Application.DoEvents();
}
private void frmLoading_Shown(object sender, EventArgs e)
{
Application.DoEvents();
tmrProcess.Enabled = true;
}
private void tmrProcess_Tick(object sender, EventArgs e)
{
Application.DoEvents();
if (iterationsCount <= 2)
{
if (pointCount <= 10)
{
lblLoadingText.Text += ".";
pointCount++;
tmrProcess.Enabled = true;
}
else
{
lblLoadingText.Text = "Loading";
iterationsCount++;
pointCount = 0;
}
}
}
}
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
Hello,
tradakad wrote: private void tmrProcess_Tick(object sender, EventArgs e)
{
Application.DoEvents();
if (iterationsCount <= 2)
{
if (pointCount <= 10)
{
lblLoadingText.Text += ".";
pointCount++;
tmrProcess.Enabled = true;
}
else
{
lblLoadingText.Text = "Loading";
iterationsCount++;
pointCount = 0;
}
}
}
You should call the DoEvents at the end of the code!
tradakad wrote: private void frmLoading_Shown(object sender, EventArgs e)
{
Application.DoEvents();
tradakad wrote: private void frmLoading_Load(object sender, EventArgs e)
{
Application.DoEvents();
}
I don't think that this is neccessary!
Apart from that, you are using the Forms.Timer which is running in the GUI Thread.
So the Timer is influenced from the action in you thread and might be throwing the Tick event not as expected (delayed)!
You could use a System.Threading or System.Timers Timer, which are running in an own thread.
Therefore you would have to invoke the Form if you want to change the Text, from the elapsed event for example!
All the best,
Martin
|
|
|
|
|
I tryed this.
private int pointCount = 0;
private int iterationsCount = 0;
public System.Timers.Timer tmrLoading = new System.Timers.Timer();
public frmLoading()
{
InitializeComponent();
}
private void frmLoading_Load(object sender, EventArgs e)
{
tmrLoading.Interval = 100;
}
private void frmLoading_Shown(object sender, EventArgs e)
{
tmrLoading.Start();
tmrLoading.Elapsed +=new System.Timers.ElapsedEventHandler(tmrLoading_Elapsed);
}
void tmrLoading_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Application.DoEvents();
if (iterationsCount <= 2)
{
if (pointCount <= 10)
{
this.lblLoadingText.Text += ".";
pointCount++;
tmrLoading.Start();
}
else
{
this.lblLoadingText.Text = "Loading";
iterationsCount++;
pointCount = 0;
}
}
//throw new Exception("The method or operation is not implemented.");
}
but i had an error in this row
- this.lblLoadingText.Text += ".";
"Cross-thread operation not valid: Control 'lblLoadingText' accessed from a thread other than the thread it was created on"
what i do incorrect?
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
Like I said, you have to invoke the method.
Invoke() is a member of control.
this.Invoke ... when this is your Form
All the best,
Martin
|
|
|
|
|
Hello,
I would add a method which sets the Text, and check there if Invoke is required.
private delegate void SetLoadingTextDelegate(string actText, bool append);
privat void SetLoadingText(string actText, bool append)
{
if(InvokeRequired)
{
Invoke(new SetLoadingTextDelegate(EnableTimer), new object[] {actText, append});
return;
}
if(append)
{
this.lblLoadingText.Text += actText;
}
else
{
this.lblLoadingText.Text = actText;
}
}
void tmrLoading_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (iterationsCount <= 2)
{
if (pointCount <= 10)
{
SetLoadingText(".", true);
pointCount++;
tmrLoading.Start();
}
else
{
SetLoadingText("Loading", false);
iterationsCount++;
pointCount = 0;
}
}
Application.DoEvents();
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
aha.. i tryed to use property but not method...
ok. i'll it to. thanx!
but why thys code dont work?
public partial class frmLoading : Form
{
private int pointCount = 0;
// private int iterationsCount = 0;
private System.Timers.Timer tmrLoad = new System.Timers.Timer();
public frmLoading()
{
InitializeComponent();
}
private void frmLoading_Shown(object sender, EventArgs e)
{
tmrLoad.Interval = 1000;
ChangeLabelText();
}
private void ChangeLabelText()
{
for (; ; )
{
if (pointCount <= 10)
{
lblLoadingText.Text += ".";
tmrLoad.Start();
pointCount++;
Application.DoEvents();
}
else
{
lblLoadingText.Text = "Loading";
iterationsCount++;
pointCount = 0;
}
}
}
}
main form --------------------
private void frmMain_Load(object sender, EventArgs e)
{
this.Visible = false;
}
private void frmMain_Shown(object sender, EventArgs e)
{
frm.Visible = true;
LoadSettings();
LoadImages();
LoadControlsPositions();
frm.Dispose();
this.Visible = true;
}
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
Sorry, I have no idea what you try to do here!
What is the timer doing here? You haven't added a eventhandler forthe timer.
All the best,
Martin
|
|
|
|
|
ok. timer can go to hell
I want that main form is invisible while images are loading. so I do this:
private void frmMain_Load(object sender, EventArgs e)
{
this.Visible = false;
}
right?
and after images are loading - form must be showed. so
private void frmMain_Shown(object sender, EventArgs e)
{
LoadSettings();
LoadImages();
LoadControlsPositions();
this.Visible = true;
}
right?
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
Like Christian said at the beginning, you should use "Application.DoEvents();".
private void frmMain_Load(object sender, EventArgs e)
{
this.Visible = false;
Application.DoEvents();
}
tradakad wrote: private void frmMain_Shown(object sender, EventArgs e)
{
LoadSettings();
LoadImages();
LoadControlsPositions();
this.Visible = true;
}
Again, DoEvents. But which event are you connected too?
All the best,
Martin
|
|
|
|
|
Martin# wrote: Again, DoEvents. But which event are you connected too?
while main from is hiding - i show loadingForm
private void frmMain_Shown(object sender, EventArgs e)
{
frm.Visible = true;
Application.DoEvents();
LoadSettings();
LoadImages();
LoadControlsPositions();
frm.Dispose();
this.Visible = true;
}
and if dont write Application.DoEvents(); label ot the loading form is not visible
when LoadControlsPositions(); is complete - i kill frm and show the main form again..
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
I see.. sorry. I had to do this
private void frmMain_Load(object sender, EventArgs e)
{
this.Visible = false;
frm.Visible = true;
Application.DoEvents();
}
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
hello i want edit row in datagrid so after clicking edit button update and cancel linkbuttons is coming what i want is after clicking update linkbutton data is not updating .
iam using vs.net2003 and asp.net 1.1
iam sending code please see and give me idea
<pre>
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
String connection = "uid=sa; password=sa123; database=usermanagement; server=c113";
SqlConnection con= new SqlConnection (connection);
//SqlCommand cmd=new SqlCommand ("select * from tbl_user_management
SqlDataAdapter da=new SqlDataAdapter ("select * from tbl_user_management",con);
con.Open ();
DataSet ds=new DataSet ();
da .Update(ds);
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind ();
}
</pre>
srinivas
sri
|
|
|
|
|
The following line of code:
this.lblImportFile.Font = new System.Drawing.Font("Tahoma", 8.25F);
is throwing the following exception:
{"Exception has been thrown by the target of an invocation." }
and I have no idea why. does anybody have any ideas?
|
|
|
|
|
Sorry forgot to mention I am using Visual Studio 2003 with .NET Framework 1.1
|
|
|
|
|
I have narrowed it down to an "Overflow or underflow in the arithmetic operation." but I still don't know why.
|
|
|
|
|
then u can see the inner exception, then u came to know whats the problem.
Ex.InnerException.Message
With regards
Amjath
|
|
|
|
|
this is working fine
this.lblTest.Font = new System.Drawing.Font("Tahoma", 18.25F);
am using c# 2005 expression edition
With regards
Amjath
|
|
|
|
|
if you can catch the exception, show it with ToString() method.
DO NOT USE MESSAGE PROPERTY
ToString() shows everything there is, Message only gives a short one-line summmary.
|
|
|
|
|
Hi to all,
I want some information about the playing the multiple video clips on the web page one by one. Please help me how can i do it.
Pravin
|
|
|
|
|
you might want to take a look at Silverlight. I remember seeing a demo at the Remix convention about several video clips being play simulatenously on a webpage. Go to http://www.silverlight.net
Edit:
Here is a tutorial which explains how to use Silverlight and streaming videos via webpage
http://aspalliance.com/1342_Streaming_a_Silverlight_Media_Application_from_Silverlight_Live#Page5
In particular go to the section titled " Invoke multiple video files from a single web page" which is the answer you are seeking.
Silverlight rocks when it comes to media streaming.
|
|
|
|
|
But i am using shockwave flash player object/component here. It does not shows the properties and events. so how can i use it.
Pravin
|
|
|
|
|
It doesn't expose properties that you can natively hook into through C#. The properties are all controlled through HTML using the PARAMS and EMBED tag on the object. Here's an example:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="superflashMovie"><PARAM NAME=movie VALUE="superflashMovie.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="/support/flash/ts/documents/superflashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="500" HEIGHT="350" NAME="superFlashMovie" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
Deja View - the feeling that you've seen this post before.
|
|
|
|