Answer Questions
mu2 Translating DataGridView row index to a DataSet row index
I have a sorted DataGridView and I need to make a change to the DataSet that is bound to the DataGridView. Here's the code I'm using: void DataGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) { BindingManagerBase bindingManager = null; bindingManager = DataGrid.BindingContext[DataGrid.DataSource, DataGrid.DataMember]; DataRow findRow = ((DataRowView)bindingManager.Current).Row; int datasetIndex = DataSet.Tables["table1"].Rows.IndexOf(findRow); } From what I understand, the IndexOf() method should take the row and find the index of it in the dataset. My problem is it's always coming back as 0. Can anyone see a problem with my code. Thanks! I know this has to be a common problem...people bind dat ...Show All
PatrickCairns controlling the focus
Hi. Does anyone know how can I make a control work without recieving the focus The thing is that I'm trying to simulate a kyboard (on a UserControl) which is added to a form. Whenevet a key is clicked, I use the SendKeys.SendWait method to simulate a keystroke. In order to process the simulated keystroke, the recieving form should be in focus. To achieve this, I use the SetFocus API function with the handler of the recieving form. So far so good - it all works fine except for the slight occasional control bar flicker when changing the focus. So - is there a way to avoid all that focus transfer You'll need to give up on SendKeys if you want to avoid the focus problem. You could send the WM_KEYDOWN and W ...Show All
Rama Krishna rao Control Array
Hello to all if i create multiple controls (10 buttons for example), how is it possible to address each control individually usin g indexes button[0].text = "some text"; button[1].text = "some other text "; ... 10x public System.Windows.Forms.Button AddNewButton() { // Create a new instance of the Button class. System.Windows.Forms.Button aButton = new System.Windows.Forms.Button(); // Add the button to the collection's internal list. this.List.Add(aButton); // Add the button to the controls collection of the form // referenced by the HostForm field. HostForm.Controls.Add(aButton); // Set intial properties for the button object. aButton.Top = Count * 25; aButton.Left = 100; ...Show All
CodieMorgan Add a DataGridViewComboBoxCell to the Insertion Row only
I can add a DataGridViewComboBoxCell to a row in my DataGridView. I want this only to be added to the Insertion Row.. New Row.. Row with a star in front of it, whatever you call it. I do not want any rows above this Insertion row to display the ComboBox, but I do want the value to still be there. Any help Thanks. That didnt do it. The event args provided no way of setting read only or turning the combobox off. Thanks anyway. Anyone else ! This is driving me crazy!!! Hi, I tried the following: Make the ComboBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing in the designer. Also, Make the ComboBoxColumn.ReadOnly = True in the designer also ...Show All
bikerchick Leftover pixels From DrawReversibleLine
I am creating a drawing program... When I draw a line I am capturing the mouse, and drawing a reversible line, which I store and redraw (to erase the line) if the mouse moves to another point. The last line will be the the one I capture on mouse up. This works, except there are a few remaining jagged edges created during the process. They all disappear after mouse up, but they are anoying anyway. Does anyone know how to fix this When I have done this in the past against the Win32 API, it was very clean, and I am looking for that cleanliness. Do I have to use the API calls Thanks, Bob Thanks, I'll look into it. And it still might be a bug. It really helped to tal ...Show All
Chris4578 Windows Media Center
I have just bought a new laptop (Dell E5105) from QVC and it comes with the Windows Media Center OS. Am I going to have to replace the OS with XP Professional I am a web designer and VB Programmer and I need to have IIS and want NTFS. Does the Media Center OS support these two items Thanks, I have the same problem. I can run IIS on a Windows 2000 machine, but I recently bought a Compaq with Windows XP Media Center, and I get the same error when trying to hit localhost. Did you ever get a fix Surprisingly, I purchased a Dell inspiron 700m last year with Windows XP Pro. I was easily able to install IIS and setup my web. I purchased a Dell Dimension 5150C last week with Windows XP Medi ...Show All
Pedro Martins Color attributes with checkbox.appearance=appearance.button
After my checkbox has been set to have the appearance of a button, it does not respond to the setting of backcolor attribute. How can I fix that Hello, Thing is this should work. I tested it by doing the following and it worked fine using VS2005. 1. Created a new project. 2. Dropped a CheckBox onto the form. 3. Changed its appearance to Button via the property dialog. 4. Changed the back color to Red. Everything worked fine. There is probably something in your code causing the issue. I'll throw out the "Clean your project and do a complete build" spiel, but I'm not sure that would help. Ken Thank you, Ken. I did what you suggested and it w ...Show All
John Q Wolf hi i need help with visual basic 2005
i have created a project and setup up small database within the program and created a dataset and know i want to retrieve data from the database/dataset and display this in a rich text box could some please help thanks steven Hi, Here is the code to retrieve data from database dim con as SqlConenction dim com as SqlCommand dim da as SqlDataAdapter dim ds as DataSet con = new SqlConnection("your connection string here"); con.Open() com = new SQLCommand("select * from YoutableName", con) da = new SqlDataAdapter(com) ds = new DataSet da.Fill(ds) To Display the data in a rich text box. I don't understand if you want to display a unique column or all ...Show All
imj Vista
Well I haven't decided to get " Windows Vista ",I'm kinda in a " Stand Still " place,First off can anyone tell me what "Vista" offers in the line(s) of " Programing " " Game Designing " " Software Development ".If someone could answer theses questions I would be very great full.Also could someone tell me if " Vista " still offers the . SAM files & Network File(s) Transfer This forum is not for general troubleshooting questions about the Windows operating system. This forum is only for Windows Forms programming questions. I recommend you to use the Microsoft Newsgroups for better responses: Windows Vista Community Best Regards. Ye ...Show All
dakota367 'System.Windows.Forms.DataGridViewComboBoxCell'
S = CType ( CType (sender, DataGridView)(indexC, indexR), DataGridViewComboBoxCell).EditedFormattedValue.ToString() I get this error mesage. Unable to cast object of type 'System.Windows.Forms.DataGridViewTextBoxCell' to type 'System.Windows.Forms.DataGridViewComboBoxCell'. What does it mean The current cell you are casting is a DataGridviewTextBoxCell, which can not be cast to a DatagridViewComboboxcell. Pwint wrote: S = CType ( CType (sender, DataGridView)(indexC, indexR), DataGridViewComboBoxCell).EditedFormattedValue.ToString() I get this error mesage. Unable to cast object of type 'System.Windows.Forms.DataGridViewTextBoxCell' to type 'System.Windows.Forms.DataGri ...Show All
Molon Labe SendKeys cannot run inside this application
Hi All I have created a class libraray using VB 2005. I am using F8 key to populate a list of value window keeping the cursor in the text box. But i get a strange message as below "SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method." My code looks like this If (sListOfValueField = "DocumentClass" ) Then Me .sDocumentClass.Focus() SendKeys.Send( "{F8}" ) Any reson for this Thanks in Advance Prash SendKeys.Send() needs an active message loop on the current thread to play back ...Show All
Kmad Creating Flat Tabs
Hey there, I'm working on an app that has one tabControl component, and which has a bunch of tabs associated with it. I noticed that in the properties for buttons you have the option to control FlatAppearance. However for the tabControl, there is no option to display the tabs flat (like that you see in Excel and Visual Studio). Its a nice look imho, and I'd like to implement it into my app. I was poking around the MSDN library to come up with something that could control the look of the tabs I found the VisualStyleRenderer.DrawEdge Method public Rectangle DrawEdge ( IDeviceContext dc , Rectangle bounds , Edges edges , EdgeStyle style , EdgeEffects effects ) Does anyone have any experience with this metho ...Show All
Garra Toolbar RTL
My toolbar is inside a Forms.Panel. How do I make the toolbar RTL I want the icons to start at the right side. I tried using the following code on the panel, but the text on the icon got flipped as well.. protected override CreateParams CreateParams { get { CreateParams CP; CP = base.CreateParams; if ( m_mirrored ) { CP.ExStyle = CP.ExStyle | WS_EX_LAYOUTRTL; } return CP; } } If I include WS_EX_NOINHERITLAYOUT to ExStyle, the toolbar won't even start on the right side. Please advice. Thanks. I have a simple workaround. You can flip your image in an image editor and give it to the toolbar control. I would also advise you to use the ToolStrip control. ...Show All
Shobha69358 Data binding and Checkbox values
Ok... I have a value in my Sql table called "Disconnected" is a bit type....0 for not being disconnected 1 for being disconnected, Now i have a checkbox in my windows form that will submit information on a product....if the Disconnected checkbox is checked how do i send that value to the sql db...I know the checkbox is a bool value so if its checked it returns true if not it returns 0 for false.......I know i can type cast a bool to a bit, so should i do that within a property or something anyhelp or any links on how to get this done will be most helpful!!! That worked! Thanks...I am using the stored procedure but i wanted to get this way to work first...thanks if (Convert.ToBoolean(IsDe) == true ) { cbox.C ...Show All
Chris.James.Boyd PropertyGrid and ListBox
Hi All Can someone show me an example of how to place a "ListBox" property within a PropertyGrid I am working on visual studio 2005. srinivasa rao Changing the order by which properties within a category is displayed is doable, however, changing the order of categories, well as far as i know and please anybody correct me if i'm wrong, that is not possible! However, I'll do some researching and get back to you i find anything. BTW, one other thing that i couldn't do with the property grid, is to change the proportions of the column widths, the area covered by the help text and commands text ... etc. You know, the internal dimensions of the property gid. This is one other thing that i think is not poss ...Show All
