|
You have to inherit the class to override methods in it.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi All
I have a problem that datagridview must have a print option in winfroms 2005. can any body help in this regard.
thaks®ards
sekhar
Hi im vijay working in mnc in the .Net technology from 4 years .
|
|
|
|
|
hi
i want to manage device(s) (for example send/recieve date) from usb device. does anybody can help me (tutorial,article,sample or ...) ?
thanks
|
|
|
|
|
I am trying to figure out how to update an activex control on a client workstation.
The client goes to our webserver and I want to then check for the existence of our activex component "CompA" on the client system. If the component "CompA" does not exist, I want to install it. If the component "CompA" exists, I want to check the version to see if it is compatible with the current version necessary for the webserver. If it needs updating on the client, I want to install the current (latest) version from the webserver.
Somewhere in all this I would like to be able to check that the user has enough rights on the client (not Guest or Limited) to do the update.
I have been trying to figure this out for a bit, starting with javascript trying to access the installed activex and query a method that returns it's version, etc.
The client workstations will be Win2000 or XP (or possibly Vista in the future). I don't have any control over whether the client workstations will have the .Net 2.0 SDK installed.
Thanx,
G
gary holbrook
|
|
|
|
|
Hello friends, I'm Back after a long long long time.... with another problem of course.
i'm using the listView control and using its Detail property for viewing data in column view.
Now i want to access values that are displayed in the columns,at runtime, and am not able to select the cell simply by clicking on it.ow can i select a cell by clicking on it by a mouse or navigate to a cell.
kindly help me out
Regards
Saira
|
|
|
|
|
ListView is incapable of doing this even in the details mode. ListView has only one item -which is trhe first column to the left by default-. The rest in subitems which can not be accessed by user. Amuch better control that would suit your need is DataGridView. It gives you the ability to access rows/columns in a much better way. Another solution is to use one of the extended ListViews provided here in CodeProject. Just search the articles for "Extended ListView".
Regards
|
|
|
|
|
Actually you need some workaround: you can use the X,Y position where the mouse click occurred (the MouseEventArgs provides the coords) to check if the point is inside the rectangle of the item (listview has GetItemRectangle method) you're are interested in (for instance, the selected one if there is: MouseClick may occur everywhere inside the listview) using the X coord you can then pick the right column.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi!
i need to read pdf files and extract text info, diagrams from it.
please help me to do it.
bye,
Asha
hi!
|
|
|
|
|
Does anybody has a suggestion on how to monitor a drive? I have a SAN device connected to a server. Let say the SAN device crashed. I want to be able to detect that the drive is no longer accisible or exist.
Samples on C++ or C# are welcome
-maybe an app running as a service!!
Any ideas are greatly appreciated
|
|
|
|
|
How about: Directory.Exists(@"D:\"); -> true or false
Just put it in a loop.
|
|
|
|
|
picasso2 wrote: Does anybody has a suggestion on how to monitor a drive?
May I suggest using FileSystemWatcher class? I believe it's the best solution in your case.
Regards
|
|
|
|
|
1>I have to retrive and display images that are present in a MS Access Database.
2>The images have been inserted in the database by the user by using the Insert Object Functionality of MS Access so the Image is displayed as Bitmap Image for .BMP and Package for .JPEG in the DataBase Image Field.
3>I have tried reading the data in a Byte Array and then display it but it dosent work that way.
//Obtain Image in a byte array
byImageArray = (byte[])Command.ExecuteScalar();
//Read the byte array to memory stream
MemoryStream memStream = new MemoryStream(byImageArray);
//Read Image from the memory stream into picture box.
picImage.Image=Image.FromStream(memStream);
An exception is thrown is Argument Exception:Parameter is not valid.
This code works fine if we store image in DataBase Programmitically by using Byte Array,but not when we access a image that had been directly in the table by user by using Insert Object Functionality of MS Access
-- modified at 7:59 Friday 12th January, 2007
|
|
|
|
|
I dragged a DataGrid from the toolbox to a form. Then I created my own class MyDataGrid and derived it from a DataGrid. Now, the instance of the DataGrid class that I dragged to the form, say dataGrid1, I replaced with an instance of MyDataGrid.
So instead of having:
private System.Windows.Forms.DataGrid dataGrid1;
I have:
private MyDataGrid dataGrid1;
After making all the other necessary changes, my code compiled but when I go back to VStudio Design View, the form is not displaying.
I know there is something inherently wrong with how I did this, but what is the proper way of associating a user-defined DataGrid to a form?
I need to use my own DataGrid version because I need to override a mouse event.
Thank in advance!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
ZapBranny wrote: what is the proper way of associating a user-defined DataGrid to a form?
I wish you'd have asked this question before doing this Davinci workaround!
Anyway. First you got to clean up your form -maybe by deleting it completely from your solution-. I don't know what else you and the designer have modified. So I believe "Better safe than sorry".
Now to your question.
1- Create a new project -whether to add it to the current solution or not is your choice-.
2- Choose Windows Control Library.
3- Now you have your user control. Switch to Code View.
4- Change the inheritance to DataGrid -or DataGridView as I would suggest. Why would you want DataGrid anymore?-.
5- Compile and you will have one error. Go to the line that causes the error and remove it:
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
6- Now when you build that project you'll get a dll file. Either reference to that dll file -after you copy it to other projects' folders-, or if your Control Library project is in the same solution you can reference to it directly using the Projects tab in the reference dialog box.
Big PS.
If you want to delete a thread in the forum. There is a link to the lower right of each message you post. Click on it and delete both the messages you posted earlier.
Regards
|
|
|
|
|
hi!
i tried to embed ur code in my c#.net based windows form de code goes as follows:
namespace Reconciliation
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
///
// temp class
///
///
/// <param name="disposing" />
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(152, 32);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "import";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(336, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
[DelimitedRecord(",")]
public class temp
{
public string aparty;
public string bparty;
public string date;
public string time;
} ///end temp
private void button1_Click(object sender, System.EventArgs e)
{
SqlServerStorage storage = new SqlServerStorage(typeof(temp));
storage.ServerName = "local";
storage.DatabaseName = "Temp tahreen";
storage.InsertSqlCallback = new InsertSqlHandler(GetInsertSqlCust);
temp[] res = storage.InsertRecords(CommonEngine.ReadFile(typeof(temp), "temp.txt")) as temp[];
}
protected string GetInsertSqlCust(object record)
{
temp obj = (temp) record;
return String.Format("INSERT INTO Temp (Aparty, Bparty, [Date], [Time]) " +
" VALUES ( '{0}' , '{1}' , '{2}' , '{3}' ); ",obj.aparty,obj.bparty,obj.date,obj.time);
}
}
}
now i get error in the line
temp[] res = storage.InsertRecords(CommonEngine.ReadFile(typeof(temp), "temp.txt")) as temp[];
and de error says:
Cannot convert type 'void' to 'Reconciliation.Form1.temp[]' via a built-in conversion
y is it so?
-- modified at 23:27 Thursday 11th January, 2007
tahreen shah
|
|
|
|
|
In my Windows.Forms app, I have a menu. That menu contains six menu items.
When the menu drops, I check a flag to see if the items in that menu should be disabled.
Here is the code:
private void miImport_DropDownOpening(object sender, EventArgs e)<br />
{<br />
foreach (ToolStripDropDownItem item in miImport.DropDownItems) item.Enabled = fMyFlag;<br />
}
This code executes flawlessly, disabling all the menu items when the flag is false.
However, once I add a separator bar between the items, this code throws the following exception:
Unable to cast object of type 'System.Windows.Forms.ToolStripSeparator' to type 'System.Windows.Forms.ToolStripDropDownItem'.
Can it possibly be true that the collection MenuItem.DropDownItems contains objects of different types? Isn't that verboten?
More importantly, why on earth would they do this? Why would any item they allow you to insert in the DropDownItem list not be treated as a DropDownItem?
This makes me pretty mad, as I'll have to write much longer code to individually disable these items.
Or am I missing something? Should I not be using "ToolStripDropDownItem" in my foreach loop?
Grr. I removed the item.Enabled = value line, and it still throws the exception. An empty foreach loop should NEVER throw an exception. If it's not an "each", why the hell is it being enumerated?
-- modified at 23:18 Thursday 11th January, 2007
|
|
|
|
|
I get the idea people just wait to see how often I'll Reply to myself.
Here's the code I came up with to replace that one line of code. If anybody knows a better method - say, using a different Type than "ToolStripDropDownItem " in my foreach loop - please feel free to let me know.
private void miImport_DropDownOpening(object sender, EventArgs e)<br />
{<br />
foreach (object item in miImport.DropDownItems)<br />
{<br />
Type typ = item.GetType();<br />
if (typ == typeof(ToolStripMenuItem))<br />
{<br />
ToolStripMenuItem mi = (ToolStripMenuItem)item;<br />
mi.Enabled = myFlag;<br />
}<br />
}<br />
}
|
|
|
|
|
Dear Joe
I can't able to clear your prob, but the below code will solve your prob.
for (int iLcnt = 0; iLcnt < toolStripDropDownButton1.DropDownItems.Count;iLcnt++ )
toolStripDropDownButton1.DropDownItems[iLcnt].Enabled = fMyFlag;
Cheers,
Chandru.
|
|
|
|
|
Thanks, Chandru. It turns out that ToolStripSeparators don't have an Enabled property, either, so either way I have to check the object type before setting the Enabled property.
How very inconvenient. And surprising, considering.
|
|
|
|
|
Hi all,
I have an application that cycles through Directories and finds Duplicate Image files (By Name).
It shows the original file name (FileInfo.Name) and the possible Duplicate (FileInfo.FullName) in the a CheckedListBox container on the form
What I want to do next is create a MouseHover Event that will show a form a bit like a tooltip with a preview of both Pictures in it.
I suppose I have a few questions.
1. Is a CheckedListBox the best solution for this to show the data? As the code runs through I store them in a List<listviewitem> which I then convert to an Array and AddRange onto the container.
2. What is the best way to get the preview to come up? I want it to dissapear as the user moves from one ListItem to another. The other issue is how can I get the MouseHover event to tell me which index I am on so I can retrieve the file paths to the imagine.
Suggestions greatly appreciated, and pointing to other online info that could me also greatly appreciated.
Regards
/TH
|
|
|
|
|
hello !!
plz do list topics for final year degree(ug) proj in c# for a beginner
MARTAND SHARDUL
B.TECH(C.S. & ENGG.)
|
|
|
|
|
How about something that trolls blog and forums for posts asking for help with school projects.
only two letters away from being an asset
|
|
|
|
|
I've got nothing against people asking for help, school project or not; people asking for complete solutions is the problem. I don't think the OP's question was out of line.
Steve
|
|
|
|
|
You dont think a student should be able to come up with their own end of year project? You think this a valuable and useful question for a forum?
|
|
|
|
|
Bear in mind, he's asking for "ideas" rather than solutions. What's to say there's no creative process in being given an idea, or even just a title, and running with that to make it your own. I was given a title for my project of "A webcam security camera". Rest assured that although I was given the title, I consider the entire creative process to be my own since the method I used and the approach I took was certainly not what would be expected from the title.
Also, the project itself is to create a solution. As a student it's incredibly hard to find a problem to solve if you have no starting point, but that isn't really the intended technical challenge of doing a computer science degree now is it? Mostly it's the people doing day to day work in the field that will have ideas for really interesting personal projects that would be possible with todays tech, but won't have the time to actually do them.
|
|
|
|