Answer Questions
Sam England String Collection Editor error: "Constructor on type 'System.String' not found"
VS 2k5, 2.0.50727. Using a PropertyGrid to try and edit an object that has a collection of strings. I'm trying to get this to work, but I'm having absolutely no luck. There's tons of people who are having the same problem, and most questions are answered with the same solution; however this solution does not work for me. I've created a sample program that replicates the error. To get this error, create a Windows Form app in C#. Add the following class to the project : public sealed class StringCollectionFailure { private StringCollection fail = new StringCollection (); private string name = string . Empty; public string Name { get { return name; } set { name = value ; } } public St ...Show All
Basani auto check a checkboxlist from a query result
I have a checkbox list that has 75+ items in it that is filled by a query. I then have query that brings back a list of items (lets say 20 items) how would i loop through that list and check off my checkboxlist with those 20 items thanks Hi, While adding the other 20 items in the checkedlistbox, please go through the below code. I havent tested this but it should work i guess. Dim I As Integer For I = 0 To CheckedListBox1.Items.Count - 1 If CheckedListBox1.Items(I).IndexOf("Whatever You Are Looking For") <> -1 Then CheckedListBox1.SetItemChecked(I, True) End If Next thank you, bhanu. ...Show All
Anabhra setting the length in a datatable.column
hello there. I have a dataset, within it i have created a table, and added columns, Is it possible that i can set the length of that column i have a string column, i want to set the field size or length of that column to 255 characters.. thanks and best regards Saad You can set the DataColumn's MaxLength property ...Show All
Xaviervp URGENT HELP - Combobox Problems
C#: Windows Application --> VS 2005 (OLEDB Connection) ------------------------ Hi, I need help on how to use a combobox to extracted list of value from A Database and use the value selected to Update to B Database. A Database (Product ID) --> Bind to combobox --> Selected value --> Update Dataset --> B Database (Product ID) Hi Natasatan, The tutorial is great but it is not what I want. Further illustration here. Customer DB, Product DB, Customer_Product DB The form is filled with textfields from Customer_Product DB. The fields are in fact data from Customer DB and Product DB. e.g Customer ID, Customer Name, Product ID, Product Description ...Show All
yeshman Automatic update works when turned off
Hi, I'd like to check for and download updates programmatically. I've turned automatic updates off, and everything works as expected besides one scenario. If I check for updates manually (call CheckForUpdateAsync), find that there is new version available, but do nothing, next time user starts the application, automatic update occurs. This is the only case when disabled automatic update kicks in. Will greatly appreciate any hint. Thanks, Dmitry Have anybody found a solution yet I just want to enquire did anyone find out the cause or this, and resolve it I am having the exact same problem, and it's preventing me from implementing a model of deployment & update ...Show All
yoshikatsu correct identification Node and building treeview
I have treeview control on my form. Each node corresponds to its message. I save everything in SortedList<string, MessageItem>, string - id node, messageitem - message. questions: 1. How i can identification each node 2. After saved, how i can do restore tree with correct order Thank you. ques t ion don't have answer yet Let the TreeView.Items collection store your objects. All you have to do is override the ToString() method to generate the string that the TreeViewNode displays. It's good for save all items as own object, but I have to store each node (as string for index) with its message and storing must be in txt-file. I'll will hav ...Show All
mrmckeb extend binding navigator service
Hi I want to add two button controls to the binding navigator for query by example first button: filter , in that case , all controls of the form are cleared , and user can enter values in the controls. second button: apply filter, when user click it , the filter which is composed by reading every control value is applied to the base table and data is reterieved. i want to add these services to the binding navigator . can you help me thanks in advance moh hassan wrote: first button: filter , in that case , all controls of the form are cleared , and user can enter values in the controls. second button: apply filter, when user click it , the filter which is composed by reading every control value i ...Show All
Bert Lefever Primary key contain was changed
I've another problem..... I've connect to a oracle database using data source wizard and bound to Data grid View( in Visual Studio 2005, VB) , and of course it adds a adapter, dataset, binding source and binding navigator automatically. It's now can be updated the table by clicking the binding navigator icon. But when I add new row and input ID field...example "05" or "A001", then save it. The records was saved,but the ID field value was changed when I open again....It changed to auto increment number, maybe by Oracle table because it's a primary key. I created the ID field in Oracle table, set it primary key, type : Varchar2, length 20. How can I input the ID field value in the datagrid.... If I make the ID field visib ...Show All
SShor Coloring TabControl.
As far as I can see TabControl object has no properties of either Back or ForeColor. Is it possible to assign these properties to this object Another question: TabPage object does have both properties but when you assign a color to it it does not cover the whole TabPage: the tab itself remains gray. Is it possible to give it colors Many thanks. nahguam wrote: Control does have a BackColor property: http://msdn2.microsoft.com/en-us/library/system.windows.forms.control_members.aspx Having said all that I don't think the benefit of being able to change the tab color outweighs the work involved... That's what I am too afraid is the case as well. I greatly appreciate your comments. I will look into the details ...Show All
Malmer Change MenuStrip Color
Hi Guys, How can i change MenuStrip Colors I am using RenderMode property, but i need a diferente color... how can i do that Thx Hi, to change colors only, you can make a new class, deriving from ProfessionalColorTable class and overriding some or all of its properties: public class MyProfessionalColorTable : ProfessionalColorTable { public override Color MenuItemSelectedHighlight { get { return Color.FromArgb(-5475813); } } ... } ... then assign this color table through ProfessionalRenderer to ToolBarManager's Renderer property: ToolStripManager .Renderer = new ToolStripProfessionalRenderer ( new MyProfessionalColorTable ()); If you also want to change the way toolstrips or menustrips a ...Show All
Mirricle DataGridView Autosize Row/Column
Is there a way to programatically replicate what happens when you double click on the seperator bar of a row/column header to resize it to fit the contents of the column/row I have multi line rows and by default the grid does not resize the row to fit the contents Anyone *shakes head* I could have sworn that command wasnt there last time i checked... I can't beleive i could have missed it... Hi Nizmo: as I know for rows we can use code as follow: dataGridView1.AutoResizeRow(2, DataGridViewAutoSizeRowMode .AllCellsExceptHeader); and for column we can use dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode ...Show All
soanfu DesignSurface creates controls offset from mouse pointer
I'm using a DesignSurface to create controls from my toolbox. I want the controls to be created exactly where the mouse cursor is when I drop them, i.e. the Location property of the newly created control should be exactly where the mouse cursor is. How can I accomplish this It seems that the DesignSurface creates the View at 15, 15 and so the controls that are being created do not take this into account. I simply create a DesignSurface and load a UserControl derived control, then add the View of the DesignSurface to a panel control in my app. If I break when that UserControl is being created the Location will show up as 15, 15. That's fine (the offset looks nice in the panel), but when I drop a ToolBoxItem I'm dragging, and say I try to l ...Show All
No-spam Sam Newbie C# Programming Question - Alarm Clock Program
Bear with me here, I'm very new to this .... Hello I'm brand new here trying to learn C#. I spent many hours trying to write a small Windows application alarm clock program. It sits in the system tray and you can set the alarm to a certain time and it will play a wav file. My question right now is how do I check the current time against what the user has selected for the alarm time I've tried to do it many different ways and it never seems to work. In the timer tick event I have something like this: private void timer_Tick( object sender, EventArgs e) { if (DateTime.Now == alarmTime.Value) { this .Restore(); Player.SoundLocation = @"C:\Windows\Media\ringin.wav" ; Player.PlayLooping(); ...Show All
textman list box and datasets
hey, how do you make it so that a list box shows the items on a dataset Thanks :) Well, the user has to be happy so I guess I will not do it that way... So becuase I dont seem to like using datasets(due to dificuly of getting it to work with my controls) I will directly save it to a XML file...and when the form loads it will take the info from the XML file and put it in bookmarks and listbox... But here is the thing, when the user clicks on add bookmarks it opens a form I made called Addbookmarks and in that form you type in a textbox what you want to name the bookmark(the name that you will see in the bookmarks list) how do I..well hold on let me try to make the XML file first and then see wh ...Show All
dzimmy Update tables using stored procedures
Hi all! I saw here similar questions but did find any proper answer. So, again... I have two tables in the DB. The master table has ID of the unique record from the details table. To retrive and store data I have two stored procedures: ALTER PROCEDURE dbo.GetAllMovies AS SELECT dbo.Movies.ID, dbo.Movies.MovieName, dbo.Genres.GenreName, dbo.Movies.Year, dbo.Movies.Description FROM dbo.Genres INNER JOIN dbo.Movies ON dbo.Genres.ID = dbo.Movies.ID ALTER PROCEDURE dbo.UpdAllMovies ( @ID int, @MovieName nvarchar(50), @GenreName nvarchar(50), @Year int, @Description nvarchar(1024) = null ) AS begin declare @GenreID int select @GenreID = id from genres where genrename = @GenreName UPDATE Movies ...Show All
