Answer Questions
Billy Porter modal form will not close
I'm using .NET 2.0 on the PC platform, and I am experiencing the exact same problem. In the example code that follows, note that I compiled the application to show the console (in addition to the windows form), so I can see the text produced by System.Console.WriteLine() statements. [Before jumping to any conclusions, note that I can compile the application without console mode support and the problem with forms hanging when launched with ShowDialog() does not go away; i.e., showing a console is not the problem here.] I do the following to launch a form: MyFormType form = new MyFormType(); form.ShowDialog(); System.Console.WriteLine("Back from ShowDialog()"); form.Dispose(); Meanwhile, in the absolute ...Show All
macyp Detail data form initial state
Dear all, I have a simple data form with a binding navigator & binding source and a variety of data entry fields. My question is - when there is no data in the database, the initial state for this data entry looks like the form is enabled for data entry although when the user saves (tableadapter.update) the app falls over as basically it wasn't in an "add new" state. The difficulty here is, I was planning to switch to "add new" prior to the tableadapter update, but this does create a new record after the first empty one. It looks to the user if they click "add new" that they are adding a second record, rather than the first one. Not very intuitive. How does Microsoft recommend this challenge is re ...Show All
Leather Refreshing a read-only datagrid
.NET 1.1 Windows Forms DataGrid I have a read-only DataGrid on my main form which is bound to a DataSet. I am creating and opening a connection (let's call it connection A) to an Access database in the form's constructor, and binding in the following manner: dgRepsAdapter = new OleDbDataAdapter(@"SELECT blah blah blah", conn); dgRepsDataSet = new DataSet(); dgRepsAdapter.Fill(dgRepsDataSet, "Reps"); this.dgReps.SetDataBinding(dgRepsDataSet, "Reps"); I also have a button on my main form. In this case it shows a dialog through which the user can add a record to the relevant table in the database. This is done directly, ie: I am not allowing the user to make any changes through the datagrid. This is a straight ...Show All
hemo String with color
Hi all, Anyone knows how to put some color to string output For example, I have this output in my listbox: string value1; string value2; myListbox.Items.Add(String.Format("{0} - {1}", value1, value2)); and now I want to color value1 red and value2 blue. How can I do that Idea/suggestion are very much appreciated. Regards. Here is an example, but if you want different color in one item, you need make the effort to draw it by youself. private void Form1_Load( object sender, EventArgs e) { listBox1.DrawMode = DrawMode.OwnerDrawFixed; &nbs ...Show All
Tryin2Bgood want to share the same instance of a user control on separate tab pages of a tabcontrol.
i have a c# user control being used on a tab page within a tab control in a vb.net winforms project public class SplitterViewControl : System.Windows.Forms. UserControl { Is there a way to reuse the same instance of that control on each separate tab page If I drag the usercontrol onto each separate tab page, I get what I would expect. SplitterViewControl2 then SplitterViewControl3. How could I access the SplitterControl1 from across the tab pages I hope the question makes sense. Thanks, -Greg What do you mean by "reuse the same instance of that control on each separate tab page" As long as the SplitterControl1 is in your namespace, you can simply access it dire ...Show All
mrboldt databound controls auto-revert back to first item?
Nevermind- this was due to the fact that my data was being populated in response to a MonthCalendar.DateSelected event. This event fires every minute, thus refreshing my dataset. Thanks.... Moderator- this can be deleted... resolved ...Show All
Wai Hon base.clone
public override object Clone() { StatusColumn col = base.Clone() as StatusColumn; return col; } somebody please tell me what is the equivalent of the above code i got in c. my program is crashing with this code.: and i think it is wrong. Public Overrides Function clone() As Object Return Me .clone End Function okay its mybase.clone!:) it does.. Public Class NoEnterColumnCombo Inherits DataGridViewColumn ... Public Overrides Function clone() As Object Return MyBase .Clone End Function ... end class you can drop your override since it basically override nothing from its base class implementation ...Show All
suranga_d tool windows
I am writing an application for my company and I would like to have a tool window similar to the solution explorer in VS that remains docked on the left side of the main application form. So far, I have created a very simple form called ToolWindowForm and set it's FormBorderStyle to SizeableToolWindow and in the Shown event of the main window I have the following code: private void ManagementStudioForm_Shown( object sender, EventArgs e) { ToolsWindowForm toolsWindow = new ToolsWindowForm (); toolsWindow.MdiParent = this ; toolsWindow.Dock = DockStyle .Left; toolsWindow.Show(); } The window is displayed fine and docked the ...Show All
Suman Ghosh error occuring in sqlserver sql statement in vb.net
hi, I wrote a small program to retrieve the record between two dates from sql server data base but the application giving a system error while i'm using # symbol to delimit the dates. my sql statement is ; "select * from table name where date_field between #" & date1 & " #,#" & date2 & "#" i tried the above with @ symbol also but the same error occuring. when i use this sql statement with the single quotes as the delimiter then it is giving the entire records in the table. the date format i changed to "DD/MM/YYYY" in the regional settings of Indian standard. Hope i conveyed the question correctly. looking forward for the solution.\ regards GRK SQL Server ...Show All
Nightmare_BE Use of the deploymentProvider property in ClickOnce application manifest
MSDN states that the deploymentProvider property is mandatory for updateable clickonce applications. I wonder why this is the case, as the codebase attribute of the deploymentProvider property always points to itself. eg, my deployment manifest is located at http://localhost/ClickOnce/test.application inside this file, I have the following tag: <deploymentProvider codebase="http://localhost/ClickOnce/test.application" /> If I generate the deployment manifest without the deploymentProvider property (and updateEnabled set), I get an error while launching the clickOnce application. This is indeed what could be expected when reading the documentation, but it is something I do not understand. Why is the property mandatory, even if it simp ...Show All
MarcoViY Live Search in a datagridview...
Hello, I wrote a DVD database program that stores your dvd info. I would like to implement a live search feature where as you type your collection is narrowed down in the datagridview. I have a binding source, datagridview, and tableadapter as such CollectionBindingSource DataGridView DataTableAdapter I have tried using this code in the keyup event of the text field with no luck, it does nothing. Me.CollectionBindingSource.Filter = "title=" & txtLiveKeywords Any suggestions Jack Bruno ...Show All
Bo_ RadioButton Groups
How to make 2 groups of RadioButtons on one form All the RadioButtons I add belongs to one group... Thanks. Bishoy If you put them in separate groupboxes, it will work. I tested it in a panel also. putting them in 2 panels will work also. Thank you. ...Show All
thukralz Closing child modal form after calculations in parent form is complete
Hi, I was trying to show a modal form just before I began some calculations within my main form and then after it was done I wanted to close the modal form. But the modal form never closes and my main form remains disabled. Here's how I did it: private void button1_Click(object sender, EventArgs e) { ModalForm modalForm = new ModalForm(); modalForm.ShowModal(); ........ some calculations ........ modalForm.close(); } Can someone tell me how I can accomplish this in an efficient & secure manner> Thanks Thanks Sean ! Even though I already accomplished the same by using threads I'll give your method a shot. Here's how I ended up doing it: void Dummy() { form.ShowModal(); } buttonCalc_Click(...) ...Show All
ankush sharma ContextMenu flickering
I'm using a dynamic context menu in my application sometimes it flickers, i can't define why or when. any ideas what happens if you set the DoubleBuffered property to true does it still flicker I'm working with C# 1.1 - i don't the doublebufer property exists in 2.0, but it does not in 1.1 It's also no good to derive from ContextMenu because it does not derive from Control, so i can do SetStyle. Thanks, but I'll need some other ideas. anyone ...Show All
YunXu ClickOnce and plugin directories
Hi, I was wondering if it's possible to configure ClickOnce such that subdirectories containing other assemblies (such as plugins) are created in the cache. At present, I have a directory containing a number of plugins and because in the ClickOnce cache all assemblies seem to be thrown together in one directory, the app doesn't work. It tries to look for the plugins in a "plugins" subdirectory and it doesn't find it since it doesn't exist. Is there a way to specify the directory structure in either the deployment or application manifests Thanks in advance for any assistance anyone might be able to provide. Norman You can definitely do this. Just create subfolders as part of your Visual Studio ...Show All
