|
No, there isn't. You'll either have to write code to use Windows Search[^] or to search the drive yourself, recursing through the filesystem until you find the file you want.
|
|
|
|
|
hi Dave Kreskowiak,thanks for suggestion.
|
|
|
|
|
Hello!
I have a custom collection editor which inherits after CollectionEditor class (System.ComponentModel.Design)and I want to programmatically add items to it's collection (listbox).
There is a method 'AddItems' which takes a collection object and items to add, but I cannot figure out what collection object I should pass to it.. So my question is, how I can get to CollectionEditor's inner item's list?
[update]
Ugh.. proper method name is 'SetItems'
[/update]
[update 2 - source code]
public class MyCollectionEditor : CollectionEditor
{
private Type m_itemType = null;
public MyCollectionEditor(Type type)
: base(type)
{
m_itemType = type;
}
protected override CollectionForm CreateCollectionForm()
{
Button buttonLoadItem = new Button();
buttonLoadItem.Text = "Load from DB";
buttonLoadItem.Click += new EventHandler(ButtonLoadItem_Click);
m_collectionForm = base.CreateCollectionForm();
TableLayoutPanel panel1 = m_collectionForm.Controls[0] as TableLayoutPanel;
TableLayoutPanel panel2 = panel1.Controls[1] as TableLayoutPanel;
panel2.Controls.Add(buttonLoadItem);
return m_collectionForm;
}
private void ButtonLoadItem_Click(object sender, EventArgs e)
{
if (m_itemType.Equals(typeof(MyCustomCollection)))
{
MyCustomItem item = ...load from DB...
SetItems( -> what goes here?! <- , new object[] { item });
}
}
}
[/update]
A man has got to know his limitations.
Harry Callahan
modified on Tuesday, July 28, 2009 6:34 AM
|
|
|
|
|
I've found solution thanks to .NET Reflector and reflection mechanism. Instead of using SetItems method I'm invoking private method of CollectionForm:
private void AddItems(IList instances) , like this:
MethodInfo methodInfo = m_collectionForm.GetType().GetMethod("AddItems", BindingFlags.NonPublic | BindingFlags.Instance);
methodInfo.Invoke(m_collectionForm, new object[] { });
PS. See the rest of code in previous post...
A man has got to know his limitations.
Harry Callahan
|
|
|
|
|
I've never written a program before but I've decided to do one using C#. I want a good looking (and free) UI, and I've decided to use either Windows Forms or WPF. I know WPF is snazzy, but can't a UI built on Windows Forms with only free components look good too?
I've read that Paint.net was built on Winforms, but I don't think the UI is very attractive. It's just Windows-style. Are there any fresher looking programs whose UI's show how good Windows Forms can look with all free components?
Thanks.
modified on Tuesday, July 28, 2009 12:12 AM
|
|
|
|
|
If you've never written an application before, then diving straight in with a barrel load of custom controls and trying to generate a snazzy interface probably isn't the best way to learn...
you may get something that "looks" good, but you're likely to have not learned anything from doing so!
[edit]also.. don't duplicate your posts. you'll get eaten by the admins [/edit]
modified on Tuesday, July 28, 2009 6:35 AM
|
|
|
|
|
Sk93, thanks for the reply. I know my ignorance is showing, but you're saying it complicates things to use custom controls? Can you tell me in what ways and to what degree?
Thanks again.
|
|
|
|
|
That depends on the quality and complexity of the custom controls you use.
Some have a nice object model that is easy to use and works very well. Others will probably force you to come up with your own work arounds or use other data objects besides the ones in the .NET Framework. Documentation may be lacking or non-existant. Support for those controls is going to come from the manufacturer of them, not any public forum like CP. ...
|
|
|
|
|
Thanks Dave. So you happen to know how Krypton[^] ranks in quality and complexity? These are the coolest free controls I've seen, and if feasible and if I don't find any better options, I'd like to use them
|
|
|
|
|
They look relatively well documented.
However, i may be wrong.. but they look very similar to the standard WPF controls...
|
|
|
|
|
Don't know. Haven't used them. Don't care to...
Use them all you want. You're the only person who can determine if they are going to work for you, based on your skill level. Personally, I'd suggest making the app work with the standard controls first, then worry about making it look pretty.
|
|
|
|
|
Thanks for the info Sk93.
Dave Kreskowiak wrote: Personally, I'd suggest making the app work with the standard controls first, then worry about making it look pretty.
This seems like a good idea if it's not too much work to get everything working with one UI, then change it. Would this be preferable to using the desired UI from the beginning?
modified on Tuesday, July 28, 2009 4:35 PM
|
|
|
|
|
Since you have no experience in building applications - yes.
|
|
|
|
|
You have a steep learning curve to deal with, work with the basics of data and manipluting that data first.
Your question is like someone deciding to build a car and discussing the paint type, almost totally irrelevant at your stage.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you want to enjoy your video everywhere and everytime, Movkit Mobile Video Converter can meet your desire.
Movkit Mobile Video Converter, which can easily convert most popular video formats such as AVI, MPG, MOV,QT, WMV, ASF,DAT, VOB, RMVB, RM, MP4, MKV, OGM and so on into portable video device formats including Sony PSP, Apple iPod, iPhone, MS Zune, PDA, Pocket PC, Archos, Creative Zen, MP4 Player with high speed and quality, is an excellent video and audio formats converter.
Now you can download it here: http://www.softwarewikipedia.com/index.php/Movkit_Mobile_Video_Converter and enjoy the convenience and pefect functions it give you. If you want to learn more about it and know how to use it, just search : http://www.softwarewikipedia.com/index.php/Movkit_Mobile_Video_Converter. In addition, you can get a discount if you buy it here. Just enjoy yourself!
|
|
|
|
|
Your post is being removed. Buy ad space like every other respectable company. You're not going to get it for free here.
|
|
|
|
|
Goodbye
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hii
i want know that when we add any data source to the project it has two options
1. No, exclude sensitive data from the connection string, i will add in my application code
2. Yes, include sensitive data in my connection string
2nd option is nuthing anyone can use it but how to use the first option ???
how to add sensitive data in application code ???
how can i do that please provide any easy way as i didnt find it
thanks
with regards
k
|
|
|
|
|
|
I have searched the net and cannot find any info for what I need to.
I am basically creating an order entry form, using a datagrid.
The basic columns in the datagrid are CODE, DESCRIPTION, PRICE
What I am trying to do is; when then user selects the item code (CODE) from a combo-box in the datagrid, the description and price are automatically inserted into the other cells (from the database).
I hope I am explaining myself clear enough.
I am sure there is a tutorial out there somewhere, but I must be searching using the wrong keywords or doing something wrong cause I can't find it.
any help would be much appreciated.
|
|
|
|
|
Since you have posted in the Windows Forms forum I assume that by DataGrid you actually mean DataGridView.
Or are you actually using a DataGrid? Which leads to the next question, is it really a Windows Forms application?
The answers to these questions makes a difference to the reply.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hey,
Yes I am using the DataGridView in a windows forms application (Sorry I should have been more specfic). I am still unsure on how to accomplish this task. . . i've been tearing my hair out :-P
|
|
|
|
|
Please do not be offended by this, but your design seems to me to be a little odd. Of course there may be constraints on you that I am unaware of and if so, please ignore this.
The point about a DataGridView is that it can display many rows of information. Bearing that in mind, why not simply load all of the data into the grid and allow the user to scroll up and down to locate the CODE they are interested in, or provide a search mechanism to allow them to enter a CODE into a TextBox and the grid would scroll the correct line into view.
Doing it in the way that you are proposing would indicate that you are using a single row, which, as I said, is slightly unusual. If you wish to do it one item at a time why not simply use a normal ComboBox on the form, with two TextBoxe s for DESCRIPTION and PRICE. Then when the user makes a selection from the CODE ComboBox you can use a paramaterized SELECT statement to fill the TextBoxes with the correct data for editing or whatever.
If on the other hand your grid would have more than one row, all blank until the user selects a CODE, this could become very confusing, with the same data being repeated in different rows, this would be a nightmare for the user and for yourself from a maintenance point of view.
I hope that this helps you, but if not please come back.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks for you replys , the design I am trying to implement is the same type of ordering entry system as MYOB Accounting, Microsoft Office Accounting and many others, . . I'm only including minimal infomation regarding this to avoid confusion, and to avoid over complicating my question, . . I will try explain it another way
These are the items in the DataGridView (CODE, DESCRIPTION, PRICE)
(There are more e.g. qty, tax etc.. however once I figure out how to do it with one column the rest will be easy, so no need to over complicate things)
--------------------------------------
CODE | DESCRIPTION | PRICE <--DataGridView Column Headers
--------------------------------------
______|v|_____________________________
^
|
The 'CODE' Column is a ComboBox populated with Item/Product Codes (read from a database (tbl_products))
When the user selects a 'product code' from the combo box the Description & Price cells are automatically populated with the relevant infomation, and a new blank row added to the DataGridView to allow another line for this order to be added
--------------------------------------
CODE | DESCRIPTION | PRICE
--------------------------------------
ITM001|v| Item 01 Misc | $100.00 <--- The user selected (ITM001) From the product code
______|v|_____________________________ <- The Description (Item 01 Misc) and price ($100) was auto-
| matically added to the remaining cells (This was read from
| infomation in a database (tbl_products))
|
|
Once an item has been added to the datagridview
a new (empty) line will be added to the datagridview
to allow users to add multiple items/products to a
single order.
The reason for implementing this type of data entry, is to allow the user to add as many (or as little) items to 1 order as needed, also with the infomation (DESCRIPTION & PRICE) being automatically inserted, this will create minimal errors and countless hours typing descriptions and prices (as anyone who has done data entry knows can be painfully annoying )
I hope this explains what I am trying to acomplish. If you need any insight to what I am trying to do Microsoft Office Accounting has an order entry system that does exactly what I am trying to acomplish.
I have included a link ^]">here to a screenshot of a quote entry form in MOA (Microsoft Office Accouting) I hope this will be useful.
Thank you for your replys, . . I apologise for my lack of explaination (and rather lengthy reply :-P) I hope this helps.
Many thanks
|
|
|
|
|
|