Answer Questions
usm2000 Redrawing a panel
Hello, I am using System.Drawing.Graphics to draw a table on panel. My problem is, the table is pretty long, so it goes off the page. I have put in a scroll bar on the side of the panel, but when I try to scroll, the table get's jumbled. Does anybody know how to tackle this problem, or can you direct me to a good website with this kind of info Do I need to redraw the panel each time the scroll is clicked If so, how do I know what portion of the table to draw I guess I'm not sure how the logistics work here... Thanks for your help! RC Could you be more specific when you say it get's jumbled. How are you drawing Are your handling the Panel's Paint event (or overriding OnPaint), or are you doing it a ...Show All
NuclearChicken 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
lwsimpson WebBrowser Control doesn't display properly (Scrollbars)
I've got a WebBrowser control in a Windows form, and I can't get the scrollbar-3dlight-color or the scrollbar-darkshadow-color to display at all. Other parts of the scrollbar change colors properly, but not those two. They don't even appear in the scrollbar itself. It's as if they don't even exist. I've spent a day looking for a solution, but can't find anything anywhere. Has anyone heard of this, or does anyone have any idea on how to get the WebBrowser to display properly (The machine has IE7 installed.) Thanks in advance for any help or pointers. ...Show All
Rune Gulbrandsen Sort Text based on number order
Hi there I have a dataset with a number of tables, all filled by reading an XML file (no sql). I'm using a DataGridView on my form to display one of the tables. The table has a field that is a string but mostly contains numbers. Sometimes it may contain letters but for the moment lets just assume the column is a string representation of numbers. I want to the DataGridView sorted based on this column, but in numeric order rather than alphabetic order. eg I want: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ... 28, 29, 30, 31 etc At the moment I get: 0, 1, 11, 12, ... 19, 2, 20, 21...28, 29, 3, 30, 31 etc Can anyone tell me how to do this All I can find is being able to sort by column ascending and decending. How can I convert the string to int ...Show All
Salil Performance Combobox 11000 Values
Hey guys, I am using a datagridviewcomboboxcolumn which is bound to a datatable containing 11,000 entries in a datagridview. This column is causing alot of performance issues, when the user moves through this column it really slows down the datagridview. Can anyone suggest any ideas to stop the column from slowing down the grid Cheers Kris Thanks for the suggestions, in the end we found a way of speeding up the datagridviewcomboboxcolumn. I created a new column which inherited of it and included the following code. The display works really fast now and we are happy with it. protected override object GetFormattedValue( object value, int rowIndex, ref DataGridViewCellStyle cellStyle, System.Component ...Show All
N8NT Auto-register new type librarys
Hi, I have a VB6 project that contains a reference to a tlb from another .Net project that I have. The problem is that whenever I rebuild the .Net project the reference in the VB6 project becomes out-of-date and I have to re-enter it (i.e. when I open the project references window it says it's "MISSING"). Is there any way that the VB project reference will automatically update to pick up the new .tlb file which will always be in the same location I have tried using the GuidAttribute and the ProgId variables as follows: [GuidAttribute("586D4B1C-B368-4cb5-8377-D3B5A7420000")] [ClassInterfaceAttribute(ClassInterfaceType.AutoDual)] [ProgIdAttribute("Namespace_Class1")] public class ...Show All
parosky Override schema with tag attribute?
This doesn't seem to work, but maybe it should....i want to override the schema's label MaxLength setting within one label tag, giving the tag an attribute of MaxLength = "400". Should that work How about an attribute for the label of PercentWidth = "100" Mark, it's hard to understand what are you taling about. Try to better express your ptoblem. I want to be sure the form width of a witd fits on a screen smaller than my dev screen. But if i set the maxlength or fixedwidth to say, 400, the form still stretches as wide as the larger screen. I also would like to know how to be sure the form is never hidden behind Team Explorer. Thanks for asking. Mark - Can you provide more detail about what you tryi ...Show All
Nick3 How to add a checkbox control in a column
how to add a check box control in a column of a Data Table.. Hi, You don't add a CheckBox control to a DataTable. You add it either to a DataGrid or DataGridView depending on what framework version you use. If you use 2.0, then you can add a DataGridViewCheckBoxColumn to your DataGridView, and bind it to a column of a type containing boolean data. Hope this helps. Luc ...Show All
Benorama Thread Killing (That do some Extensive Work)
Hi, I am intantiating thread that do more extensive work, i.e. executing query on FoxPro 2.6 through ODBCDataAdapter with VisualFoxPro driver. Since the query executing is Complex and navigating through 870000 records and taking a time about 2-2.5 minutes. Once the thread is started and goes for data retrival. Meanwhile if I try to close the form. The thread is still running. I have also added Code for killing thread in Closing event of form using Abort() method. But it does not kill the thread. Instead the threadstatus returned is AbortRequested. Please help me in this regard, as Closing event fire the thread should returned and leave the resources. Thanks It's generally a bad idea to use Thread.Abort; it forces the thread to abor ...Show All
jepptje Accessing data in code
Hi I have opened a data connection to an access db in my vb.net windows form app. I need to do the following but am not sure how to do it in code; 1. Open one of the tables 2. Read column values from first record. 3. Insert the record into a second table in the same db. 4. Delete record from first table. 5. Go to step 1 if any records are left in first table. Would appreciate if someone can give any pointers on how to achieve the above in code. Thanks Regards Yahya ...Show All
Leonard Lee newbie: binded data for date and change the datetime format
Elo... i have a column in dataset with format mm/dd/yyyy 12:00AM (hmm from wat i've read so far mayb this is US format). When i do this... DateTime date = Convert.ToDateTime(dataset.Tables["master_table"].Rows[CurrentRowIndex].ItemArray[15].ToString); xrBill_Date.Text = date.Day + "/" + date.Month + "/" + date.Year; The output is what i wanted ---> eg. 18/1/2007 but the prob is the date is repeated (eg. there are 5 bills...the date from the 1st bill is repeated from 1st bill to last bill) So..i do this... xrBill_Date.DataBindings.Add(new XRBinding("Text", dataset.Tables["master_table"], ColumnName_Master[15])); DateTime date = Convert.ToDateTime(xrBill_Date.ToString( ...Show All
Lightening subclassed DataGridView OnCellValueChanged weird stuff
Hi I have subclassed a datagridview, and placed code in its DefaultValuesNeeded event (on the form). It looks like this: Private Sub dgv1_DefaultValuesNeeded(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles dgv1.DefaultValuesNeeded With e.Row .Cells("ID").Value = 0 .Cells("Start Date").Value = Now.ToShortDateString .Cells("End Date").Value = Now.ToShortDateString End With End Sub It works - which is great. You can tell that this datagridview contains 3 columns: ID, Start Date and End Date. In my subclassed datagridview control, within the overridden OnCellValueChangedEvent, weird values are coming across when the above event is ...Show All
h1 Datagrid Paging alignment
I have a problem. When i place a DataGrid on an aspx page in Visual Studio 2005 the page no comes to the extreme left of the page. I tried changing the alignment to right or center but still it is displayed in the same manner. If any body has a solution please let me know Hi, Thanx for having patience and answering a rite qn in a wrong place. The environmnet details are as follows: IDE:VS 2005 Dot Net version :ASP.Net 2.0 Browser: IE 6.0 OS:Windows 2003 server The sample code is as follows <asp:datagrid id="dgdArticles" runat="server" OnPageIndexChanged="ArticlePageChange" OnItemDataBound="FormatArticlesGrid" AllowPaging="True" BackColor=&qu ...Show All
AtomZ .be Parsing Rich Text Box line by line
Hi, Im looking to get some help as i am trying to input a large number of words into a rich text box and then either put them into a data set or by some other mechanism get them as individual strings so that they can be exported to an XML file. I have had a good search online and there doesn't seem to be anything, therefore im not even sure if this is the best way to deal with this. If there is a better way can someone please let me know. i dont mind what way i do it ultimately Thank you Myles Hi, It seems that you want to it be treated the same way every 3 lines You can do it by a loop like this: for ( int i=0 ; i < RichTextBox.lines.length ; ++i) { switch (i%3) { case 0: //deal with th ...Show All
Dmitry Arefievich NumericUpDown Controls...how to select the text when it gets the focus
I am looking for a way to select the contents of the control when tabbed into/focus....it does not have SelectionLength/SelectionStart properties.... Hi, This just mimics the behaviour I want, but does not simulate it. When I use the code you suggested in the Enter and Leave events, the controls change color as desired, but that's about it. What I want it to do is when I start typing&n ...Show All
