Answer Questions
EWANAME System.Data.ConstraintException
In my first ADO.Net 2.0 project I'm trying to create a Windows Forms application that allows updating customer records. These records are in an SQL Server 2003 database, and I am using the VS.Net 2005 DataSet Designer to create a typed DataSet and Customer TableAdapter. To start, I just output the internal IDs of fields to TextBoxes on a form. So far, so good. One of the fields is for Language (English, French, Spanish, etc.), and there is a database table with language names and IDs. So I add a new Language TableAdapter and Relation to the DataSet Designer. The Relation is: Parent table: Language Child table: Customer Key Column: Language.languageID Foreign Key Column: Customer.languageID Both Relation and Foreign Key ...Show All
JRuggs Connecting to a Web Service
Our Client Application needs to connect to a webservice, which is in the same solution, different project though. I can do it perfectly on my box, and it works, however, it's defauled to "localhost". All of our customers have their own sub-domain for their site. Example: Customer1.OurSite.net Customer2.OurSite.Net ... Customer532.ourSite.net And so on. So... When they first run this application, I ask them to input their website address, which I save to an XML file. This way that client will be set to lock-onto that website. How do I tell my application to point the webservice to Customer1.ourSite.Net instead of localhost Theoretically I want to change the settings in that XML file 10 times in 10 minutes and have the application hit each ...Show All
Kornfish Binding an Array of objects to a DataGridView
Now I think the DataGridView is the best control to use for this, if I'm wrong let me know :D I have an object that has a property that returns an array of "PackageDetails" (custom object). This object has 10 public properties that I would like to bind to the DataGridView. I am very used to the DataGrid/Repeater/DataList etc. in ASP.NET and I'm having some trouble with WinForms. Any help on this would be great. The above procedure should also work with plain arrays... Andrej I have to use a plain array because I serialize the class out to XML. I guess I could implement another property to return a List<>. Thanks for the help. Hi, I'd suggest something in a way of: Drag your DataGridView o ...Show All
SPflueger Does a Java BorderLayout-like thing exist in C++?
Hi! I have to design a form for an application, which components are only a label and a panel. Now I need that the label is located at the top of the window and the panel at the center. Moreover: 1) I want that there are not any "blank spaces" between the window border and the label and panel borders 2) the panel sizes are given run-time, and the other components sizes are modified consequently to fulfill the previous constraints. In Java, all this could be done with the BorderLayout command (eg: contentPane.add(panel, BorderLayout.CENTER); contentPane.add(label, BorderLayout.NORTH); ) . (I tried to use the "Dock" command, but id doesn't satisfy me because in this way I cannot modifying the size of the ...Show All
Dace86 How to display context menu on my window Title Bar
Generally context menus will be displayed inside the form. But if we right click Form's Title Bar, it wont be displayed. How to make it possible , please give me any suggestions. Hi, This can be implemented by overwrite the WinProc method of the form: protected override void WndProc( ref Message m) { const int WM_NCLBUTTONDOWN = 0x00A1; //When click the left mouse button on the window title bar if (m.Msg == WM_NCLBUTTONDOWN) { this .contextMenuStrip1.Show( Cursor .Position.X, Cursor .Position.Y ); } base .WndProc( ref m); } Hope my answer can help you.Regards. Ye ...Show All
syndicate Setup and deployment project, resilient feature
Hi, I have created the setup which install the exe file in application folder and .gif files in the Image folder. If the user deletes the .gif files/icon files from the image folder and when the user tries to run the application, application starts repairing the installation. My question - i) Is this inherent feature in the deployment package ii) Is there a way to disable the resilient feature, so that even if the .gif files are deleted from the image folder, the application continues to run as it is without invoking a repair Kindly let me know if any one has the answer to this question! Thanks, Rajshekhar The too ...Show All
HeatherLK Problem with List<T> and TypeConverter
Hi, I am having a bit of difficulty with TypeConverters and Generic Lists and I was hoping that I could get a bit of advice. I have a type converter that is used to create the constructor code for my component. (It is an XNA a Game Component, but I don't think that that has anything to do with the problem because it appears on a Winform) inside another component. For instance I have the following: public class A{ private string s; public string SProp { get { s = value;} set { return s;} } public A() { s = "" ; } public A( string inS) { s = inS; } } By itself, when class A is an object on a form (or in my XNA Component) the TypeConverter code works fine, the property grid on t ...Show All
chubbysilk How to pass a list[] into a listbox?
Hello, is it possible to copy a complete list [] at once into a listbox without using the 'for' or 'forever' statement Regards, Henk Which ListBox are you talking about System.Windows.Forms.ListBox has an Items property of type ListBox.ObjectCollection which supports AddRange... It works, Thanks! I'm reading the comports from my computer with it and get a list: COM2 COM1 is there a kind of 'sort' operation possible ('SortedList' does not seem to be the answer...) Henk Hi, Please mark best and acceptable replie(s) as the ANSWER(S) This helps other ppl to find the right answer easily and faster if they have same questions as ...Show All
I am me Message to remove previous installation
The installation program sends a message to remove the previous installation. Can this be automatically done. I tried by changing the Remove previous installation in the project property. This should help: http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/ I am using Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600,Visual Studio 2005 Professional. I dont know about any previous installations. I mean about setup project I created in Visual Studio. which Visual Studio version is this happening on What operating system are you running did you install any beta's or CTP's before of the product if so, which ones ...Show All
i_dont_care DGVComboBoxColumn DataBinding
Hi all, I have a DGVComboBoxColumn and its .DisplayMember and .ValueMember are defined to "ColA" and "ColB" respectively. Now, I have a DataSet containing ColB and bind to it, how can I predefine / set the index / display ColA as the DisplayMember accordingly I set the DataPropertyName to ColA or ColB and it doesn't work. Thanks, ...Show All
Tryin2Bgood in Immeidate window it works but not on class- RTF-clipborad
Hi All, I've a very simple problem. When i convert simple text into RTF in a class it doesnt work but whne I see the result in immeidate window I'm able to see the actual result. Why is this difference Please see the below code and its very simple and starightforward but I'm struggling to findout the root cause. Dim objData As New DataObject(strText) Clipboard.SetDataObject(objData) Dim reverdata As New DataObject reverdata = Clipboard.GetDataObject() 'now get the new object If Not reverdata Is Nothing Then strRichText = reverdata.GetData("Rich Text Format", True ) End If when i see the value of reverdata.GetData("Rich Text Format", True ) in immediate ...Show All
Feng26 General question: how do we search on the various dotnet languages here?
There is a lot to wade through in this Microsoft developer forum. Is there a way to search for messages containing the Microsoft supported dotnet languages C# or C++ Even searching for C# and C++ as strings would be very helpful, of course. Certainly on a Microsoft site as this it is possible to search on these somehow, obviously. As such, please pardon my significant ignorance in this regard. hi! thanks for replying. Yes, I know these search boxes. But I don’t know how to use them to solve my search problem. Here is my search problem: how do I construct a search in these WindowsForms forums so that only posts that mention C# or C++ are returned Each forum has a search box loc ...Show All
3Nu Move borderless Form problem
Hi, I created a borderless Form, and I tried to move this by MouseMove function I found some articles using Drag But I want to know what's wrong in my function My code is: private: System::Void display_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { if(img2){ e->Graphics->DrawImage(img2, 0, 0); this->Width = img2->Width; this->Height = img2->Height; } } private: System::Void display_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { if(mouseState==1){ if(Math::Abs(mouseX-e->X)>1||Math::Abs(mouseY-e->Y)>1){ int x = this->Location.X; int y = this->Location.Y; int newX = x + e->X - mouseX; int newY = y + e-& ...Show All
JDPeckham DateTime picker
This control is starting to give me fits. I am finding more and more reasons not to use it except in the most simplistic ways. The first problem is the control doesn't allow nulls. I know the checkbox work-around, but that requires more code and more user interaction. The second issue I am having is when writing the date value to the database, even though I end edit on the bindingsource and validate the form, the date retains the previous value until you tab out of the control. For instance, if you use the arrow keys to change the date, and then click a save button (on my toolbar), it writes the previous value. Anyone know why this occurs. I would use a textbox and validate a user-entered date but havin ...Show All
Abdollah Drag And Drop events
I want to be able to drag and drop a control anywhere on a form while its executed....I am trying to do it but it wont let me drag what am i doing wrong private void textBox1_MouseMove( object sender, System.Windows.Forms.MouseEventArgs e) { if (MouseButtons.Left == MouseButtons.Left) { this .DoDragDrop( this .textBox1,DragDropEffects.Move); } } This is how i tried it again I just want to be able to move a combobox control with my panel....but this gives me no results...or any errors...any help on what i am missing... private int posx; private int posy; private void comboBox1_MouseDown( object sender, System.Windows.Forms.MouseEventArgs e) { ComboBox cb = (ComboBox)sender ...Show All
