|
i can not programmaticly set dateee.Checked = false; once it was set true.
Where is the trick?
|
|
|
|
|
If the .ShowCheckBox property set to true ?
DateTimePicker.Checked Property[^] docs on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ShowCheckBox is set true ...and its checked in my datepicker box.
now i wana set it to unchecket state again (while program running) with Checked = false but nothing happen. the datepicker checkbox stays checked.
|
|
|
|
|
That's indeed a bug. When you set its Checked property to false , it actually becomes false , but the control still is painted as if it were true .
I remember reading about it, and what I recall to have worked is to set the Checked property to true and then immediately to false .
Try that and tell us if it works.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
thats exactly how i solve it. if i want to set checkbox in unchecked state, i have to set it first true and then immediately to false. i also noticed...
if you programmaticly set value to same date that already is (checkbox is unchecked), checkbox dont get automaticly checked. i think that checkbox should get checked=true(automaticly) every time you set a value, if we look that checked is set to false by default.i see checkbox as an confirmation that value was really set.
|
|
|
|
|
I have used the checkbox in the DateTimePicker control to register the date when a vaccine was applied to a child. If the the checkbox is checked, then the vaccine has been applied and the date specifies when. If the checkbox is unchecked, the vaccine hasn't been applied, and the date doesn't matter (it's grayed out.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I need to create 2 dimensional arrays. How can I store them? I don`t know how many of them, so the collection must be done dynamicaly.
The second qestion is, how can I display all of that arrays in one ie List box, data grid?
thx
|
|
|
|
|
Just create an Arraylist of arrays. Like
public class Foo
{
ArrayList list = new ArrayList();
public void Add(int []x)
{
list.Add(x);
}
public void ListAll()
{
foreach(int [] arr in list)
{
for(int i = 0; i<arr.Length; ++i)
Console.WriteLine(arr[i]);
}
}
}
Each element in list can be an array of any size and there can be as many elements in the list as you want.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks,
but how can I display every element of this list at once (containing 2 dimensional array objects) in windows forms ?
Maybe use data grid, but have no idea how to.
|
|
|
|
|
I'm trying to open a local file in the WebBrowser control but I cannot figure out, how to do it.
How do I do that?
|
|
|
|
|
How to view AutoCad file in C# like zoom in, view, zoom out. Please tell me. Thank.
|
|
|
|
|
You're going to need a component that can read and understand the file format and render it properly. I don't know of any. You might want to check with AutoDesk to see if they have something that might work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am running the following code. It executes when the value of variable i is 1 and when the loop continues and value of i becomes 2 i am getting error "Object reference not set to an instance of an object" in the cmdSearch.CommandText line in the code. . There is no problem with connection string. It successfully retrieves when i = 1. Can anybody help me out what is the problem. Please post with corrected code if anybody can help.
===========================================
for (int i=1; i <= objFolder.Items.Count; i++)
{
System.Data.OleDb.OleDbConnection odbSearch = new System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbCommand cmdSearch = new System.Data.OleDb.OleDbCommand();
odbSearch.ConnectionString = strConn;
cmdSearch.Connection = odbSearch;
item = (Outlook.ContactItem) objFolder.Items.Item(i);
string em = item.Email1Address;
cmdSearch.CommandText = "select * from Outlook_Contacts where FirstName='"+fn.ToString().Trim()+"' and LastName='"+ln.ToString().Trim()+"'";
odbSearch.Open();
OleDbDataReader rdrSearch = cmdSearch.ExecuteReader();
while( rdrSearch.Read())
{
RecordFlag = true;
}
odbSearch.Close();
}
===========================================
|
|
|
|
|
What are fn and ln? Where are they defined?
|
|
|
|
|
fn and ln are declared outside and the values are properly getting passed to those variables. The code executes when i=1 and when the value of i becomes 2 the error occurs. There is no problem with connection string also. only when the code executes to the commandtext line it shows the error. that too i am getting one record successfully(when i = 1). hope this helps
|
|
|
|
|
well, some thing is null. It is either item, cmdSearch, fn or ln.
can you step through it in VS and check?
|
|
|
|
|
I have done that. I am getting one record ie. when the value of i = 1. When the value of i increases to 2 then in the commandtext line this error occurs. And also fn and ln are fine. Can you please tell me how to solve it?
|
|
|
|
|
Like bigtrev said, just step through and check fn and ln .
Or perhaps you got the line number wrong and item is null.
Anyway, just step through and check.
Btw. you know that building SQL commands the way you do is highly vulnerable to SQL injection?
You should use parameterized queries instead.
Regards,
mav
|
|
|
|
|
hi,
when enabling visual style in an application ,tool bar button disappear , how to cater it so that visual style and tool bar button can be enable at the same time.
|
|
|
|
|
Don't forget the call to Application.DoEvents();
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new AgilePlannerMainForm());
Maybe that solves your problem.
Claudio
Claudio's Website
|
|
|
|
|
Please tell me the way to build a "Add-in" in .Net. I also need some documents and articles about this detail.
You can mail me at: vonhattruong@yahoo.com.hk
Thank you very much
|
|
|
|
|
What do you mean by Add-in in .NET? An Add-in for Visual Studio .NET? Or an Add-in architecture for your own application?
Anyway: Why don't you search here on codeproject? There are several articles about Add-Ins for Visual Studio as well as complete Add-in architectures for your own applications.
Claudio
Claudio's Website
|
|
|
|
|
It's "Add-ins for Visual Studio .Net" . Thank you for your information. It helps me a lot in my project.
|
|
|
|
|
In my setup project (for Windows application), a dependency is shown for the dotNETFXRedist_x86_enu.msm. However when i try to include this in my setup file (by removing the checkbox on Exclude button on this file)
"dotNETFXRedist_x86_enu.msm must not be used to redistribute the .NET Framework. Please exclude this merge module."
What can be the reason? Do i have to include some other file for including the .NET framework in my setup program?
|
|
|
|
|
The merge module is there for VS.NET to check the dependencies of your program.
The Exclude flag is set by default because M$ doesn't allow distribution of the .NET framework this way.
You have to install .NET prior to installing your app.
MSDN[^] describes the different ways you can go.
Regards,
mav
|
|
|
|