|
This is the reason most events are actually raised in a
protected virtual void OnEvent method.
Override the OnMouseClick method, and in your overriding method, call base.MouseClick if/when you want to call the base classes event.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks a lot. Works like a charm.
|
|
|
|
|
I tried this and it worked correctly for me. AFAIK, events fire in the order it is subscribed. Since you hooked the event handler in your control's constructor, it should execute first. Or as Davey suggested, override OnMouseClick method.
|
|
|
|
|
How i connect MYSQL with C# for Windows mobile Application.plz help me its urgent
modified on Saturday, April 18, 2009 1:43 AM
|
|
|
|
|
Have you tried MySQL connector .NET?
|
|
|
|
|
I'm trying to rework some code posted by GWSyZyGy called Detecting Application Idleness.
It works fine in VS .net 2003, but when I try to convert it to vs 2005 or 2008, I get an error message that TargetInvocationException was unhandled by user code.
This occurs in the constructors area of the timer code, as follows:
private void OnApplicationIdle()
{
// Check to see if anyone cares.
if (ApplicationIdle == null) return;
// Build the message
ApplicationIdleEventArgs e = new
ApplicationIdleEventArgs(this.lastAppIdleTime);
// Iterate over all listeners
foreach( MulticastDelegate multicast in ApplicationIdle.GetInvocationList() )
{
// Raise the event
multicast.DynamicInvoke( new object[] { e } );
}
I am getting an error on the very last line.
I hope this is enough of the code to clarify what's going on. If so, can someone kindly shed some light on why this is happening?
Thanks
|
|
|
|
|
TargetInvocationException is too general. You need to look into InnerException property to see what is the exact error.
|
|
|
|
|
Hi. thanks for looking at my earlier post.
When I tried to look at the inner exception, I got to this page in MSDN:
http://msdn.microsoft.com/en-us/library/fd85b3df.aspx
Does that make it any clearer to you?
Thanks
|
|
|
|
|
Hi
When i try to debug a Windows Application it says "Application failed to initialize properly". It also gives "hpqwmiex Module has encountered a problem and needs to close. We are sorry for the inconvenience". What is that i should be doing for this error
|
|
|
|
|
Do yourself a favour and Google for 'hpqwmiex Module'. You will get a lot of hits, some of them about viruses!!!!
Only you will be able to tell which of them apply to you.
Good luck! I hope that you don't have an infection.
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 got an untyped DataSet that holds some disconnected data I queried from a server. I'm trying to add a DataRow with this block of code in a button.
I get "The name 'newMEALSrow' does not exist in the current context". But if I comment the line with the id, I can get the WinApp to compile and run, but if I add a row, the id to the row will be empty.
DataRow newMEALSrow = dsMEALS.Tables["MEALS"].NewRow();
newMEALSRow["id"] = System.Convert.ToInt32(txtID.Text);
newMEALSrow["name"] = txtName.Text;
newMEALSrow["description"] = txtDDescription.Text;
dsMEALS.Tables["MEALS"].Rows.Add(newMEALSrow);
Any comments?
|
|
|
|
|
Raymundo Valdez wrote: newMEALSRow
C# is case sensitive. Your variable name is newMEALSrow not newMEALSRow
|
|
|
|
|
tyvm
|
|
|
|
|
Hi ,
I am trying to display a crystal report using the crystal report viewer in vs 2008,and it does not display instead it gives a database login screen.
This is the code which I am using .
==================================================================
CrystalReport1 objRpt;
//Usermaster objRpt;
objRpt = new CrystalReport1();
string connstr = "Persist Security Info=False;userid=btssys; password=xx23;database=bts;server=xxxx";
MySqlConnection mc = new MySqlConnection(connstr);
try
{
mc.Open();
string sql = "select userid,
usergiven,userfamily,status,expiry,created,created_by
from user_master";
MySqlCommand cmd = new MySqlCommand(sql, mc);
MySqlDataAdapter adp = new MySqlDataAdapter(sql, mc);
//new MySqlDataAdapter(
DataSet ds = new DataSet();
int li_rows = adp.Fill(ds, "myds");
if (ds.Tables[0].Rows.Count == 0)
{
MessageBox.Show("No data Found", "CrystalReportWithmysql");
return;
}
// Setting data source of our report object
objRpt.SetDataSource(ds);
// Binding the crystalReportViewer with our report object.
crystalReportViewer1.ReportSource = objRpt;
================================================================================
If I debug I can find that the ds is retrieving the rows. But nothing comes up on the crystal report viewer.It displays a database login screen instead with server name as myds. Is this something to do with Mysql or something wrong with VS 2008 or crystal report coding.
Thanks
|
|
|
|
|
Hi all,
I resolved it myself, change the
DataSet ds = new DataSet();
int li_rows = adp.Fill(ds, "myds");
I used a datatable and changed the retrieval to
adp.fille(dt) ;
objRpt.SetDataSource(dt);
and it works
any ways, thanks everyone.
|
|
|
|
|
Hi
i have 3 tables :
Roles (roleId [int], roleName [varchar])
Objects (objectId [int], objectName [varchar])
Permissions (permissionId [int], roleId [int], objectId [int], allowView [bit], allowChange [bit])
Note : Permissions.roleId is foreign key for Roles.roleId
and Permissions.objectId is foreign key for Objects.objectId
in my form, i have :
comboBox to display avialble roles (data come from Roles table)
datagridview to display available objects (data come from Objects table)
two checkBox (View , Change )
i want, when user click on each object in dataGridView, security info for selected Role and object display by two checkBoxes,
but i don't know which dataSource is appropriate for checkBoxes .
Note : i have a DataSet in my app with that 3 tables included with their relationShips ,
but i don't know how to bind this controls to display correct data for each Role and Object.
|
|
|
|
|
I writing some application that in some point i need to get some PDF file and put all the text in the PDF into some Rich Text control.
I don't know how to set the text of the PDF file ....
Thanks for any help.
|
|
|
|
|
What you are proposing is not easy.
There are several open-source PDF Libraries available and I suggest that you Google for 'PDF C#' and do a lot of reading.
When or if you get stuck with some actual code that you have tried, ask again.
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 a DayCell usercontrol class, which has a property Date (of type DateTime).
I also have a MonthCal usercontrol which has a collection of DayCells.
Finally, I have a YearCal usercontol which has a collection of MonthCals.
I would like the YearCal to have a DateChanged event which is fired when a DayCell is clicked.
I would like the Date property of the clicked Daycell to be made available to the YearCal client (via an EventArgs-derived parameter).
I could create an event in MonthCal that is subscribed to by YearCal, which then fires the DateChanged event.
There MUST be a more elegant way for the click event and date information to propagate from DayCell to MonthCal to YearCal, but for the life of me, I can't figure it out.
I would be grateful for any suggestions.
Thanks,
tfhain
|
|
|
|
|
Hi,
if your YearCal holds say 12 MonthCals (lets hope it instantiates them by code, not by Visual Designer manipulations), then yes the proper way would be for it to subscribe to each MonthCal's Changed event and act upon it.
It seems like you are creating almost 400 controls to represent one year's worth of calendar.
That is a lot of stuff, and it is bound to paint rather slow, and react sluggish to all kinds of events (Form minimize/maximize/restore, repaints when uncovered, etc). I would recommend a more lightweight approach using maybe only one Control where you do all the painting explicitly, and the keyboard/mouse interaction by explicit code. It will probably result in less code (more hand-written code though) and far better performance.
|
|
|
|
|
In your current set up, that is the correct way IMO.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
HI everyone!!!
Im workin on an application in C#, im stuck up at the login window. I want to sign into my application usin the login window. So, how can i do that usin MS Access. while using the login window it shld check the username and password and then make the user to log in. pls help??
|
|
|
|
|
Start here[^] to read up on implementing user-level security. For more information, see the MS Access section [^]on the Microsoft Office site.
I are troll
|
|
|
|
|
i need to compare tow picture from picturebox
i read the picture from database and i need to ompare from other picture
|
|
|
|
|
You should ask specific questions, and tell us what you did so far to show your knowledge and commitment. Failing that, you will get down-voted and mocked about, as has happened before.
|
|
|
|