|
SrNo, which is an int represents survey no. Each time I change the item in combo, it is changed.
"doesn't do the job" means SurveyChooserCombo.SelectedIndex seems to be left unchanged.
When I run the application the form doesn't change the display as expected.
Also cannot run it in debug mode, as I get "there is no source code available for current location", when trying to run over method more then once- to make the change in index come true.
sea#
|
|
|
|
|
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method>>)
???
This is done automatically by Visual Designer - simply naming method SurveyChooserCombo_SelectedIndexChanged does not automatically associate it with the control...
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
Hope this helps.
Regards
JP
|
|
|
|
|
Petras J. wrote:
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method="">>)
???
I do have event handler.
Petras J. wrote:
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
it is just an ordinary drop-down list. Nothing complicated.
What else should I do to make it change once selction changed?
TIA,
sea#
|
|
|
|
|
Wrote this code:
private void SurveyChooserCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (SurveyChooserCombo.Text.Equals("Survey1"))
SrNo = 1;
else if (SurveyChooserCombo.Text.Equals("Survey2"))
SrNo = 2;
else if (SurveyChooserCombo.Text.Equals("Survey3"))
SrNo = 3;
else
SrNo = 3;
GetResults (SrNo);
}
stil event is not fired, dsiplay doesnot changed.
|
|
|
|
|
Hello,
How can I update the specific row in the dataset, where the
row["ProjectID"] == someValue1 and row["VersionNumber"] == someValue2.
I don't want to loop through the whole dataset using foreach statement.
So, what would be the notation for such operation?
Thank you
|
|
|
|
|
You could use DataSet.Table.Select to retrieve the row then update it.
DataRow[] rows = ds.tables[0].select("projectID=? and VersionNumber=?, "ASC");
|
|
|
|
|
Thanks,
But how do you access the data to modify in rows?
rows[0] does not work.
|
|
|
|
|
Are you saying that you want to update the same field in every row in your dataset using one statement?
Can't be done. You'll have to loop through the dataset and make the changes you want to each row individually.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, just want to update one row in my dataset, becuase every row in
my dataset is unique.
Thank you
|
|
|
|
|
Is there any way possible to make a textbox with a unchangable string in it ->
like a timebox (in windows time) with "19:23:23", which you can change only the numbers but cannot touch the ":"?
|
|
|
|
|
You want a masked edit text box. There are plenty of third party ones and examples of creating them here.
2.0 has a masked edit textbox as a built in control if you can wait that long.
|
|
|
|
|
Looking for info/code/tutorial on how to get the information that is supplied on a printer test page using C# (or C++/VB). Things such as the total number of pages the printer has printed, the total printer memory, etc. I tried using the WMI printer object (Win32_Printer) but it does not provide the number of pages prior to the last reset, while the printed test page directly from the printer does.
Thanks
|
|
|
|
|
There is nothing in the Win32 API that will do this. You must get this information directly from the printer, more than likely over TCP/IP. But the procedure used will vary from printer to printer and manufacturer to manufacturer.
At best, you'll have to get this kind of information from the printer driver. You'll need the doc on the driver (good luck!) to find out if it exposes any kind of API you can use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you for the response , although it does complicate things a bit, it does set me in the right direction as well. I guess I'll have to get the printer driver from the Win32_Printer object, then for each type of printer driver use its API to retrieve pages printed.
Thanks again
|
|
|
|
|
Neomaya wrote:
I guess I'll have to get the printer driver from the Win32_Printer object
Won't happen. You don't "get" the driver from Win32_Printer. WMI won't help you in doing this project at all.
You'll have to make direct DeviceIOControl calls to the driver. That's why I said you'll need the docs on the driver, which will probably be very difficult to find, if at all.
Also, the API calls between drivers will NOT be the same. Manufacturers, and even different models, will have differing command structures, so writing some generic code won't work. You'll have to write specific code for each manufacturer and, in some cases, driver you want to support.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If anyone could help me with this exception I'd be very grateful. I can't figure out why I'm getting it.
I'm working with an MDI application. I'm just trying to close the child form with a cancel button. Here's the code:
private void btnCancel_Click(object sender, System.EventArgs e)
{
theParent.hasSetupCostTracker = false;
this.Close();
}
The variable "theParent" is defined as a public variable and in the constructor of the form I have the code:
theParent = (frmCostTracker)this.MdiParent;
hasSetupCostTracker is simply a boolean public variable of the parent form taht I use to make sure that no more than one of this type of child form is open at a time.
If I take out "theParent.hasSetupCostTracker = false;" then the code works find and doesn't throw any exceptions.
Can anyone explain this error and/or give me a good workaround? Thanks!
(oh yeah, and the exact error message that I get is:
An unhandled exception of type 'System.NullReferenceException' occurred in Benefit Select Application.exe
Additional information: Object reference not set to an instance of an object.)
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Run debugger and track the value of ur theParent object. Are u sure it's not empty? I mean, r u sure abt ur casting in the constructor? Check if it contains the expected value.
|
|
|
|
|
Thanks for responding.
I ran the debugger and double-checke that the theParent object is not empty. It's not.
The value I get for it is:
Benefit_Select_Application.frmCostTracker frmSetupNewCostTracker01.theParent
Trying to track down the problem I also tried adding the line:
MessageBox.Show(theParent.hasSetupCostTracker.ToString());
in the cancel button method to see if I could at least access the value of the hasCostTracker variable. I got this error:
Cannot pass 'Benefit_Select_Application.frmCostTracker.hasSetupCostTracker' as ref or out, because 'Benefit_Select_Application.frmCostTracker.hasSetupCostTracker' is a marshal-by-reference class
I have no idea what a "marshal-by-refernce" class is.
OK - while I was typing this message I tried something else, and now it works. I copied the line from the constructor
(theParent = (frmCostTracker)this.MdiParent;) into the cancel button method. So now it works.
But I'm still curious, do you know why the exact same code successfully initializes the reference in the cancel_button method but not in the constructor (there's only 1 constructor).
Thanks for your help.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Can someone pls tell/show me how to minimise a window/form to the taskbar.
|
|
|
|
|
When, I say taskbar, I mean the system tray, where the part of task bar where date, time, and Icons are displayed at the right hand corner.
ty.
|
|
|
|
|
Search CodeProject for NotifyIcon. When minimized, set the NotifyIcon of the form, and set the forms "ShowInTaskbar" property to false.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
ty u guys.
Never mind. I've solved it.
I went thru the online docs.
|
|
|
|
|
I want to learn the best practics to implement applications using layers. I already search on the web, but i still confused. Does anyone can teach me those pratices, redirect me for a site, something that could show me how to do it, and do it weel, samples, something precise?
Thanks
|
|
|
|
|
|