|
Hi,
How can i change the icon of windws custom control. i am using
System.drawing.Toolboxbitmap["icon"] that's change the icon on toolbox, but i want change the same icon when it drag to the main form .
please help.
please check the first image of this article.
http://www.codeproject.com/useritems/VDir_Control.asp[^]
|
|
|
|
|
Abhijit Jana wrote: but i want change the same icon when it drag to the main form .
When the control is dragged to form, where do you expect the icon to be changed ? In toolbox ?
|
|
|
|
|
N a v a n e e t h wrote: In toolbox ?
No , not in Toolbox
N a v a n e e t h wrote: where do you expect the icon to be changed ?
while drag the contrl in form, it is coming on bottom section . and i need there should be same icon.
just for example, While Selecting SaveDialog, when we drrag the icon on form, it comes to bottom section of form and icon remain same,
and if you look on my last article, that i have send the link icon are diiferent .
Can you please help me !!!
Thanks in Advance !!!
|
|
|
|
|
I have the code to retrieve a list of files/folders from an ftp-site and I have the code to extract an icon from a local file but can I get the icon from a file on an ftp-server?
Is there a way to get the standard icon used by the local system for say ".rar"-files without actually having the file?
|
|
|
|
|
You'll have to use p/invoke for this. The corresponding win32 function is SHGetFileInfo[^].
You don't need an actual file, a file name alone will do.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks for the help, after a lot of searching and reading I found a really good class to work with over at eggheadcafe.
If someone is interested, here's a link IconHandler
Cheers, Johan
|
|
|
|
|
Hello,
I'm new in C# programming and I have a question.
I want to delete a row from a table using a button.
The row i want to delete must have the same information that the selected cell in a grid view.
How can i do that?
Thanks.
|
|
|
|
|
All you need is a stored procedure that takes as a parameter the ID of the row you wish to delete. Obtain the ID from the selected row in the grid.
only two letters away from being an asset
|
|
|
|
|
write CommandText = "delete from <tablename> where <row identity=""> = " + >gridview selected item<
hope it will help
Becoming Programmer...
|
|
|
|
|
Hi.
To delete the row from table by pressing button with selected value from GridView:
protected void btDelete_Click(object sender, EventArgs e)
{
GridViewRow gvr = GridView1.SelectedRow;
con.Open();
cmd = new SqlCommand("<stored procedure="" name="">", <sqlconnection object="">);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@xID <procedure parameter="">", SqlDbType.VarChar));
cmd.Parameters[0].Value = gvr.Cells[<cell id="">].Text;
cmd.ExecuteNonQuery();
}
Thanks Wish Helps U.
Good Thing Goes With Good Guys.........
|
|
|
|
|
Hi All,
Slim pickings for this topic on MSDN [1, 2]. [2] does not really apply, but it was a keyword hit ("SelectedItemChanged"). Does any one know how to receive this notification? I'm not receiving it.
What I done so far: Hightlight the TreeView in Design Mode, and then switching to Events: no SelectedItemChanged available. I tried the following (TreeView control name is ObjectTree ):
private void ObjectTree_SelectedItemChanged(object sender, EventArgs e)
{
...
} Sorry about another beginner question. I have no idea what to do with (from [1]):
public static readonly RoutedEvent SelectedItemChangedEvent Pasting it into the code resulted in compile errors. The Microsoft Wiki[^] is looking more appealing every day.
Jeff
[1] TreeView.SelectedItemChangedEvent Field[^]
[2] DomainUpDown.SelectedItemChanged Event[^]
|
|
|
|
|
Hi Jeff,
I don't know, I haven't had much experience with TreeView, but I noticed your [1] ref is
on .NET 3.0 suggesting SelectedItemChangedEvent does not exist on 2.0 (assuming that's
what you use), which confuses me since 3.0 is said to be identical to 2.0 except for
extra modules (WPF, WCF, ...).
RoutedEvent is unknown to me; it too requires .NET 3.0
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi Luc,
Luc Pattyn wrote: I noticed your [1] ref is on .NET 3.0 ...
That would make it an ID-10T eror... I despise being on this end of the learning curve.
Jeff
|
|
|
|
|
Jeffrey Walton wrote: on this end of the learning curve
is there an other end? I thought it was like a rainbow...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Huh? A rainbow...
So it starts off really hard, then eases out. And as time goes by you slowly forget everything you already learned?
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
The Undefeated wrote: A rainbow...
Yep. It invites you for a long journey, but you will never reach the end (remember,
that's where the pot of waffles and pie is). I can't remember the part about forgetting
everything though.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have an older imaging toolkit that I use in a number of apps and I am trying to migrate one of them to C#. The toolkit has a number of ActiveX OCX controls. I have tried to add them to my C# app, but to no avail. I use SharpDevelop as my IDE.
So far, I have been able to add references to my app, but I cannot find a way to add the controls as components so that I can drop them onto my forms. Can this be done, and if so, how do I go about doing so?
Thanks in advance,
William
|
|
|
|
|
Hello all,
If i am showing a message with a MessageBox how can i close it myself with a timer...?
Thanks for the help...
Luis E Tineo S
|
|
|
|
|
You can't. Create your own form that looks like a message box so that you can put a timer on it.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Oh well... I think that it is much better since i can have it look the way i wanted, plus i can have more control over it.
Thanks for the info!!!
Luis E Tineo S
|
|
|
|
|
|
OK, I love to learn new and better ways to do things, but this just doesn't seem one of them.
I'm originally from the Java camp so I've used straight DB code such as hard coded calls to the database and ORM tools like Hibernate. I've been working in VB for the past 5 years on various projects and have used similar techniques here as well.
I am working on a fairly large project and decided to use strongly typed db access such as what is taught in these fairly popular tutorials:
http://www.asp.net/learn/data-access/[^]
Boy am I getting a headache. It seems to me that the only benefits I get are IntelliSense and compile time checking. IntelliSense wasn't available before strongly typed database code so this is more of a convenience than any real need. Compile time checking is nice but I've already had several errors that are not caught until runtime. These errors largely deal with enforcing constraints when filling a DataTable using a standard DataAdapter. Most of these errors are extremely trivial, do not interfere with my actual code and would never have been brought to my attention without strongly typed db code.
So here is what I see as the major negative. I feel like I am getting much more code dependence rather than the current shift towards independence. This project largely works with data from a vendor database. If they ever update their schema (which can be as often as once a week) my app will break, even if they simply change a field from varchar(10) to varchar(12).
I'm starting to lean towards either rolling my own db code or using NHibernate again. Also, LINQ seems to be a departure from this strategy as well.
Does anyone else have any comments? Have any of you used strongly typed db code on a large project and found it to be indispensable? What am I missing?
Thanks!
Matt Penner
|
|
|
|
|
We use XPO[^] here at work. We had done it "by hand" previously, and XPO saves us tons of time.
That said, it's not a walk in the park. There are still issues, such as the db scheme change breakings (although XPO handles most schema changes automatically OK).
Most O/R mappers give you database independence; your code will work with MS SQL Server, MySQL, Oracle, Access, whatever.
Overall, I'm certainly glad we have an O/R mapper. It could be better, but it's far, far better than doing it by hand.
|
|
|
|
|
Judah Himango wrote: It could be better
Yes it could. As a work around, don't do development that uses databases... actually don't do development that uses data at all.... oh what heck just don't do software development. Hey maybe the circus that's in town could use another clown?
|
|
|
|
|
led mike wrote: Hey maybe the circus that's in town could use another clown?
Sorry, I went there last night and took the LAST CLOWN JOB IN TOWN. Ha. Take that, you clown-wannabe.
|
|
|
|