Answer Questions
NumberKruncher MDI and Maximized Forms
I have a MDI program that when I maximize a child form, and then close that form it seems to freeze up the program. It seems to work fine as long as I don’t close any maximized forms. Is this a known error Thanks William I know of no known bug of this sort... what kind of code do you have running on the child or parent form when the child form is closed ...Show All
hackmonkey DataGridViewButton
Hi guys, I have a datagridview with one column as a datagridviewbutton, but i dont need all the rows to show the button, I’m trying with no luck to make the cell visible when needed or even to change the backColor of the button to white, but It doesnt show. does anyone have any idea, Im hopeless. this is the code i use : dataGridView1.Rows[0].Cells .Style.BackColor = Color.Red; I think you should define a DataGridViewButtonColumn. Hi W.ang Chi, If I define the column as DataGridViewButtonColumn. I can only make all the rows visible or not, and i can’t control only one cell for example. Hope this thread is helpful for you http://forums.microsoft.com/MSDN ...Show All
digitalsuperman Master-detailed tables dataset, cannot update child table
Hope anybody can help, since i lost the whole day trying to figure out a solution to my problem. Here is the scenario: two related tables in a MSSQL2000 db. parentTbl PK linked to childTBL FK I got a dataset with the two tables and the relation between them. I drag an instance of both tables (detail view) on my form and i got everything working fine with the bindingnavigator browsing through records and i can delete and update previous ones. The only thing that i cannot achieve is how to insert a new record into childTBL and have it into my db. It seems to work only if i drag an instance of parentTbl on my form as a detail view and then i set another instance of my childTbl as a datagridview, in this case i can actually insert a new record ...Show All
rmtuckerphx adding data to a gridview that has data in it from xls
I a grid view that is being filled by xls sheets.(preformated). I can get one sheet loaded, but if the user wants to add another xls to the data currently in the grid view. the databind is cleared how can i just add the new sheets data gv1.AutoGenerateColumns = False Dim myconnection As System.Data.OleDb.OleDbConnection Try Dim DtSet As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter myconnection = New System.Data.OleDb.OleDbConnection( "provider=Microsoft.Jet.OLEDB.4.0;data source= " & TextBox1.Text & " ; " & "Extended Properties=Excel 8.0;" ) MyCommand = New System.Data.OleDb.OleDbDataAdapter( "select * from [she ...Show All
Sanjukta DGV w/ CalendarControl
I have a DGV with a calendar control. The calendar control works fine for those rows that have an entry in the field. When clicking on the DGV to enter a new (line) entry, the default value which was in the calendar cell from the code is replaced to a NULL value. This change causes an understandable "InvalidCastException" in trying to convert the (Null) value to a date. The default value is set at the table.column database default as (CONVERT([datetime],CONVERT([varchar],getdate(),(1)),(1))). I've also tried just getdate(). --- [I'm having a second issue with the combo filter which I'll inquire after sorting the first issue. ] All help is greatly appreciated, thanks. Code for the form is: [CODE] Impor ...Show All
Terry Smith Converting Text to UPPER case in a datagridview control
Hi, I've tried everything but don't seem to be able to get this to work. The seniario is this. A user inputs some text in a cell of a datagridview control and I want the text to be converted into upper case before it is stored in the database. This data is a KEY field to a table. I've tried the format method of the defaultcellstyle and the onvalidate row, and cell events but can't seem to be able to figure this out. Has anyone ever needed to do this before And, would you mind tell me how to do it Thanks, Dave Hi, Yes it says something about implement your own DATAERROR event to not display this message (something like that). I did try to implement my own event but i found then I nee ...Show All
pmarreddy How do I set the location of a control loaded at runtime?
I've created a Button control that I want to locate on the bottom of the form. How can I use the form's size attributes so that no matter how the form size is changed, the button(s) will always be centered along the bottom of the form At this point, I'm dragging a button control from the tool box and positioning it on the form then, using the button's Location property to use in the code then deleting the button from the form. I can vaguely remember in VB 6.0 that you would use the form's ScaleWidth and ScaleHeight but these are not in C#. Needless to say, I'm kinda lost. Rhubarb Hi, The Height and Width property can be accessed in the constructor. I tested your code, and it works fine despite the fa ...Show All
Rod Yager Removing focus from a text box
i have a welcome textbox. it is multi lined, readonly and displays a message. Originally the whole text was highlighted. i removed this with this.textBoxWelcome.SelectionLength = 0; but the flashing cursor is still at the beginning of the text. i have tried giving focus to another control but the cursor remains. how do i go about removing the cursor Hi Speedie nice to see you on the forum again. You're going to get that cursor until focus advances to a control that can accept keyboard focus. It's Windows way of showing the user "You can type here" and is not the same as .net's concept of focus. Of course if you get real fancy you can over-ride the behaviour of just about everything -- but ...Show All
Ori' reating BufferedGraphics resulting in "Parameter is not valid" exception
Hi I try to use double buffered graphics. The following lines work: private BufferedGraphicsContext plotBufferedGraphicsContext = new BufferedGraphicsContext (); private BufferedGraphics plotBufferedGraphics; protected override void OnPaint( PaintEventArgs pe) { plotBufferedGraphicsContext.MaximumBuffer = new Size (100, 100); plotBufferedGraphics = plotBufferedGraphicsContext.Allocate( this .CreateGraphics(), graphRect); This line doesn't: plotBufferedGraphics = plotBufferedGraphicsContext.Allocate(pe.Graphics, graphRect); Some questions: 1) Why can't I use the Graphics form the paint event The content of the 2 Graphics is the same, except that the PageUnit for thi ...Show All
JavaBoy Get USerProfileName
<workingFoldersSection> <XmlSerializableHashtable xmlns:xsd=" http://www.w3.org/2001/XMLSchema " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "> <Entries> <Entry> <key xsi:type="xsd:string">email</key> <value xsi:type="xsd:string">c:\shankar\Email</value> </Entry> </Entries> </XmlSerializableHashtable> </workingFoldersSection> I have an entry like this is my Web config file and i use a dictonary entry in my code and get the vaule which is a "c:\_Enterprise\Email" and just create folder.Now i want to get the USERPROFILE name and use it like "c:\"userprofilename"\shankar\Email ...Show All
Lightening host usercontrol on a modal child form?
I just set the Mainform's 'IsMdiContainer' property to true but when adding the following code to a tab controls selectedIndex changed event, the form does not appear. Any ideas Can I do this (successfully) Can I simply change this formerly NonMDI app to on that supports modal forms thank you. -greg NewMDIChild.Controls.Add( Me .UserControl) NewMDIChild.Location = New System.Drawing.Point(100, 100) NewMDIChild.Size = New System.Drawing.Size(400, 200) NewMDIChild.Visible = True NewMDIChild.TopMost = True NewMDIChild.Show() Thank you Andrej. I am thinking I better move the buttons, its a kind of switchboard control, from a form to toolbar buttons...I do see that I am using the MDI ...Show All
PaulYuk_MS Send current page by email through script
Hi I need to create a link in the web page that will open the default email client. I should be able to set the current page as an attachment and set the email to address. I can use mailto protocol but it is not possible to attach the current we page. Appreaciate your assistance in this. MHA I think it would be ok if you using a stream to read current page's comtent, like follow private string GetHTML( string url) { System.Net.WebClient client = new System.Net.WebClient(); try { byte [] buf = client.DownloadData(url); //message.Text = System.Text.Encoding.GetEncoding("GB2312").GetString(buf); return System.Text.Encoding.GetEncoding( "GB2312" ).GetString(buf); } catch ( Excepti ...Show All
ashk1860 Automatic insertion of rows thru datagrid (.net 1.1) windows Forms
hello every one, this is my first post to this community here, well I have this problem that I'm working on a master detail form in C# (.net 1.1) in windows Forms and the problem is that when the user inserts data into the grid and goes to the next row. it is automatically getting inserted. What I want is the other way around. I want the user to click the Save button when he's done inserting data in teh DataGrid u know. I've seen that u can use DataGridView Class to stop that from happening but I'm afraid If i'm not wrong its not there in .net 1.1... So can any one here help mw get around this problem What should I do thanks in Advance using System; using System.Drawing; using System.Collections; ...Show All
Sergey Sotnikov Whidbey DataGridView Scroll control info using GetScrollBarInfo fails
Hi, I used GetScrollBarInfo WinaPI method to get the DataGrid's HScrollBar/VScrollBar Thumb position and other details and this returns perfect result in this case, but the same function when I tried to get the DataGridView's Scrollbar details it returns me false and doesn't populate the ThumbBottom,ThumbTop,rcScrollBar rectangle information. Does anyone know why it doesn't work and how can I get the ScrollBarInfo for the DataGridView control Is there any way that I can get the Thumb information without going thru InterOp Thanks, Nitin Sharma DataGridView uses scroll bar controls, not the window scrollbars. You have VerticalScrollBar and HorizontalScrollBar properties but they are protected so you will need to deriv ...Show All
IxxI Datagrid fill problem
Hi, When I fill a simple datagrid, the first row of my table is always duplicated to the end. Then I cant do anything, the program crashes. What could be the problem I use VB.net 2003. When editing the table in the IDE, everything works fine. Thanks for help, Ok, I solved it myself. The problem was that somewhere in the name of a column, i entered something wrong (a space). So, it duplicated the first row, and then an error occured. Greetz No, that is the strange thing about it. And it only duplicates the first row-input of the table (wich gives then a conflict off course). All other functions work fine... Anyone an other idea what could be wrong is the fill method called twice somewher ...Show All
