|
Never mind - I figured it out. It is passed as "Index" in the event args object!
dpb
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
I want to display a month calender in which only saturdays can be clicked on and highlighted and also how can i acquire all the saturdays in a month?
Thanks
VisionTec
|
|
|
|
|
The windows month calendar control is very weak and not flexible. The only thing you can really do is catch date changed and check if it's a saturday. You can do much more than that.
>> How can i acquire all the saturdays in a month?
math + DateTime class
Alex Korchemniy
|
|
|
|
|
Take a look at this calender control[^], it's very flexible and surely can achieve what you want.
Regards,
mav
|
|
|
|
|
My dataset has 2 tables having foreign relationship. After I update these 2 tables in my dataset, how can I update them from my dataset to my real database?
Thanks.
|
|
|
|
|
DataAdapter[^]
Study the ADO.net model a little more. There are some great books out there + MSDN.
Alex Korchemniy
|
|
|
|
|
Can you tell me a little more?I searched in MSDN but I could't find the way to solve this problem.Thanks
|
|
|
|
|
How to store image file in Access 2003.Thanks
|
|
|
|
|
hi there,
I remembered that there is a field "OLE object" field used to store any binary data.
So u could use it to store image
<< >>
|
|
|
|
|
Hi all
I have a problem about how to reach an object of a class that is in the memory but dont have name, I'll write an example to discuss
if there is a class called man
public class man
{
string Name;
int length;
}
now the user of the program makes a lot of objects of the class man by using this code in a button
private void button1_Click(object sender,System.EventArgs e)
{
man m = new man;
m.Name = textbox1.Text;
m.length = int.parse(textbox2.text);
}
now there are a lot of objects of the class man in the memory but they dont have a name. How can I reach an object of them or in other words how to save objects of a class so that i can reach them
Note: that in my real program the class is not simple like that it contains complex data types
mego mego
|
|
|
|
|
You need to store a reference to the object somewhere. An ArrayList is a good choice:
<br />
ArrayList Men;<br />
.<br />
.<br />
.<br />
private void button1_Click(object sender,System.EventArgs e)<br />
{<br />
man m = new man;<br />
m.Name = textbox1.Text;<br />
m.length = int.parse(textbox2.text);<br />
Men.Add(m);<br />
}<br />
You can then access the objects through the ArrayList, for example to find the man with a name stored in a string:
<br />
private man Find(string key)<br />
{<br />
foreach (man m in Men)<br />
{<br />
if (m.Name == key)<br />
{<br />
return m;<br />
}<br />
}<br />
return null;
}<br />
There are more efficient ways to do it and different collection you can use depending on exactly what you want and how much coding you want to do up front. For example, you could create your own collection which keeps the names in order so you can search them more efficiently.
|
|
|
|
|
the m object not accessable outside button1_Click
at all even if they have separate name because its scope
so you need to store them like other response suggest and access them later by index or by key depending on the collection type
MCAD
|
|
|
|
|
thanx to u Wjousts and thanx to mohamed also i think that the array list is a good choice
i ll try it
|
|
|
|
|
Hi Guys,
I was wondering if anyone can help me out with a problem.
If I leave my application idle for a while then I get a "Table 0 not found error" on any page that needs to access the database...
i am guessing this happens since the database times out...
how can I handle this exception in a way that if the user leaves the application idle for too long then it would redirect the user back to the login page (I am using .NET Passport for authentication)
Thanks
|
|
|
|
|
Hello,
This week I was given something cool to do. Take a Tablet and Ink enable our Tiff viewing app. Sounded easy. This is what I have:
1 Microsoft.Ink.InkPicture inkPic, that I’m loading with inkPic.image = SomeTiffFromFile
I’m not bothered by scaling problems yet.
This control captures Ink and saves it as Strokes and it works wonderfully. I’m trying to save the Ink into the Tiff.
This is what I have tried:
First I bring the Tiff into Drawing.Bitmap bmp = Image.FromFile(“filename”) (this is the same file I use as the inkPic.Image) Then I make a new Graphic from the Bitmap. Since Ink is made of Points (Ink.Strokes[Foreach].GetPoints(Foreach)) I figured I could do this
Graphics g = Graphics.FromImage(bmp);
for (int i=0; i
|
|
|
|
|
i've a textbox in my form.
I would to learn how to draw an image inside the area of the textbox at the place the classic white.
I don't want a dll that make it but just learn how, so i can do the same for other objects and create quite custom objects.
Thanks.
|
|
|
|
|
At general to customize the drawing of control you drive your class from it and override OnPaint but not al controls easy for customization like others to look at code do what you want look at Tile a Bitmap Into a TextBox Background[^] it is in VB6 but you can get some ideas from it
MCAD
|
|
|
|
|
I am sorry but i am posting this again because I didn't get reply for my problem if any one can help me please.
I want to pass parameters to crystal reports but i dont know how i found example on microsoft site
// Declare variables needed to pass the parameters
// to the viewer control.
ParameterFields paramFields = new ParameterFields ();
ParameterField paramField = new ParameterField ();
ParameterDiscreteValue discreteVal = new ParameterDiscreteValue ();
ParameterRangeValue rangeVal = new ParameterRangeValue ();
// The first parameter is a discrete parameter with multiple values.
// Set the name of the parameter field, this must match a
// parameter in the report.
paramField.ParameterFieldName = "Customer Name";
// Set the first discrete value and pass it to the parameter.
discreteVal.Value = "AIC Childrens";
paramField.CurrentValues.Add (discreteVal);
// Set the second discrete value and pass it to the parameter.
// The discreteVal variable is set to new so the previous settings
// will not be overwritten.
discreteVal = new ParameterDiscreteValue ();
discreteVal.Value = "Aruba Sport";
paramField.CurrentValues.Add (discreteVal);
// Add the parameter to the parameter fields collection.
paramFields.Add (paramField);
// The second parameter is a range value. The paramField variable
// is set to new so the previous settings will not be overwritten.
paramField = new ParameterField ();
// Set the name of the parameter field, this must match a
// parameter in the report.
paramField.ParameterFieldName = "Customer ID";
// Set the start and end values of the range and pass it to the
// parameter.
rangeVal.StartValue = 42;
rangeVal.EndValue = 72;
paramField.CurrentValues.Add (rangeVal);
// Add the second parameter to the parameter fields collection.
paramFields.Add (paramField);
// Set the parameter fields collection into the viewer control.
crystalReportViewer1.ParameterFieldInfo = paramFields;
Problem is that when i write this code for my reports in c#
I am not finding
"paramField.ParameterFieldName"
in intellisence. I am seeing some other methods but they gives error. I am using V.S. 2003 and crystal report 9.0
Please can any one tell me why its happening
I would be obliged.
Naveed Kamboh
|
|
|
|
|
I haven't been at CP for a while. Hi everyone.
Naveed, if you search through previous post I bet this question was answer multiple times.
I quickly pulled up a file using Google desktop search and I found a function that I used on a previous project. Take a look at this. It might help you:
private void SetParameter(string name, string val)
{
ParameterFieldDefinitions paramFlds = report.DataDefinition.ParameterFields;
ParameterFieldDefinition paramFld = paramFlds[name];
ParameterDiscreteValue discreteValue = new ParameterDiscreteValue();
ParameterValues paramValues = paramFld.CurrentValues;
paramValues.Clear();
discreteValue.Value = val;
paramValues.Add(discreteValue);
paramFld.ApplyCurrentValues(paramValues);
}
Alex Korchemniy
|
|
|
|
|
how to use java script in my asp.net page Anurag Verma 18:06 23 Sep '05
Dear....
I want to use some validations for my forms in asp.net and i want to use java script.Please help me out and tell methe way how to use it
|
|
|
|
|
There are many ways you can use Javascript in your asp.net
ASP.Net come with some validation of controls did you looked to them if no one of them have what you need you can use CustomValidator control and write your javascript
for validating the control for example look at
Allowing Only Numbers in ASP. NET TextBoxes[^]
If You want to call JavaScript code when you click Button for example you can write somthing like
Button1.Attributes.Add("onClick","DoIt();");
this allowed DoIt script function to be called when the user click the Button or write the code directly like Button1.Attributes.Add("onClick","alert('Test Test');");
MCAD
-- modified at 21:30 Friday 23rd September, 2005
|
|
|
|
|
[rant]I've only been at it for about an hour and already don't like it! I'm a long c++ programmer, MFC -- MS-Windows. All I want is a form with an edit box where you can type in a filename and a button that will let you browse for the filename. In C++ I would simply use VC++ 6.0 to create an MFC project, create and initialize an object of type OPENFILENAME, then call the win32 api function. Simple. Without knowing better, using Visual Studio .NET 2003 I created a windows C# project, made the form like I wanted (that was pretty intuitive) then clicked the button on the form to get the event handler. There, everything goes to hell in a handbag. The compiler knows nothing about OPENFILENAME structure. So I downloaded the sample C# tutorial project from codeproject. I can't believe the kind of hell C# programmers have to go through just to do one simple call to a Win32 api function. Its enough to make me throw in the towel and use C++ instead.[/rant]
Isn't there an easier way to accomplish this?
-- modified at 17:34 Friday 23rd September, 2005
|
|
|
|
|
There most certainly is an easier way to do it and it's approximately 1700 times faster. If you ask nicely, I might even tell you about it
|
|
|
|
|
Pretty-please I suppose I probably should buy a book about C#.:->
|
|
|
|
|
See the other reply. You won't learn about a new language and framework in an hour. Believe me, from experience, C#/.NET is ten times faster/easier to use than the corresponding Win32 API (with or without MFC) in 99% of the cases. You'll just have to search for the appropiate classes to do your job.
One thing .NET is a thousand times better is that it has been designed from the ground up, so all the classess are very consistent with each other, whether you are developing a Windows or a web app.
Take your time to learn this new technology, and I'll bet anything you won't want to go back! :->
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|