Answer Questions
Patrick Keller BindingNavigator - Detail/DataGridView
I am quite new in VB I am trying to make a simple form with tables from a SQL database.I have three tables ( 1 parent and 2 children) shown as details. They areralated in a dataset with primary keys and FK. I have added two sets of data into thedatabase. When I run the application it works out fine, and I can shift between the two sets of datawith the navigatorbar. The three tables shifts correctly. However - when I add a new record into the application and save it, it is only the parent table that obtains the data. The two other tables become empty when shifting away - and back to the new record. I would be very pleased if anyone can help me out of this problem. I now found out that my application works out fine when the parent ...Show All
DRoden Display text in an ownerdrawn listview - again.
Hello, The concept goes like this: The user selct n number of rows in a listview, and then right-click the mouse, and select an item from the popup menu. How many items - and which one - the user selected, and the text to display in the columns 1, 2 and 3, is determined in the sub shown below. So far, so good.The problem is that I can't see a way to get the text into the listview, and I don't know what triggers the DrawItem event in this case - control is Ownerdrawn. I would be grateful for some hint to point me into the right direction in this matter. Thanks for your help! -- Doffen Private Sub SettInnHToolStripMenuItem_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettInnHTool ...Show All
data_architect Add entries to ComboBox in DataGridView
The best way to ask this question is to describe the simplest scenario of what I am trying to do. So here goes. I have two business objects: 1) Address - For simplicity assume only 3 columns : ID, Street, City_ID 2) City - Columns: ID, CityName I would like to have a form where the address is in a DataGridView control and the User can get the City from a dropdown or combobox. Thats the easy part, I know how to do that. What I want to achieve is something that is easy to do in MS Access but an equally simple solution in VS2005 has been eluding me: First, if the list of Cities is empty, I don't want a gridviewcomboboxcell error. Second if a user types in a city that does not already exist, I want that city to be added dy ...Show All
Mohan1 C# vs2005 .Net 2.0 ListView .HitTest(...) always null for ListViewItem
Hi, I am having a problem with the ListView controls .HitTest method, to be honest I am not sure if this is a misunderstanding on my part. I am trying to provide edit controls for various fields within a ListView control by overlaying various controls (TextBoxes, ComboBoxes etc) onto the clicked Item/SubItem. I originally thought I would have to invoke HitTest from win32 to obtain details of the SubItem under the click region, however I found that the .Net 2.0 ListView impliments .HitTest() directly. It returns a ListViewHitTestInfo object, amoungst the various members of this object are .SubItem and .Item I perform the HitTest in the ListView controls MouseUp event, and it workd as expected so long as the clicked item is a ListViewSubItem ...Show All
Rudemusik Changing the UI at runtime
I want to be able to change the GUI depending on what the user has selected. (There is four buttons each providing specific functionality about what can be done to the screen) At the moment i am setting the positions and hides all manually, changing the anchors all manually. Is there a way to do this with the designer Maybe something like putting all the GUI on a form like thing then i can load that into my main form http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=182878&SiteID=1 look and ye shall find. ...Show All
Igor Grozman Windows Time in a TextBox control
How would I go about retreiving the Windows Time and displaying it in a textBox (And can it be displayed in military time Standard time ) Hi, you can retrieve system time using DateTime class: textBox1.Text = DateTime .Now.ToString(format); Look here for date/time formatting options. Andrej Common: Now.ToString("h:mm:ss tt") Military: Now.ToString("HH:mm:ss") With apologies to the rest of the world... ...Show All
Anpiro String Function for repeating character string
in VB6 we can use String Function for repeating character string of the length specified, what can be used in windows mobile or visual studio Hmm, I must be a bit dense here as I am not finding it in visual studio 2005. I am converting an embedded vb project targetted at pocket pc's to a windows mobile environment, but can't find that I am looking to do something like a=string(3,"x") result a= "xxx". Someone suggested string.padright (3,"x"), but that doesn't appear to be available in the mobile environment! The String() function is still around in VB.NET. For C#, you could use this replacement: public static string FillString ...Show All
donnie100 how to erase item on listbox
Can anybody tell me how to remove the item on listbox I want to do when I select an item and click Delete button, then selected item removes. The code is something like this; private void AddButton_Click(object sender, EventArgs e) { listBox1.Items.Add(textBox1.Text); textBox1.Text = ""; } private void DeleteButton2_Click(object sender, EventArgs e) { listBox1.SelectedItems.Clear(); } When I test DeleteButton event, it seems to remove successfully, but the item still exist. I appreciate your tip. Thanks. foreach(object obj in listBox1.SelectedItems) listBox1.Items.Remove(obj); Wouldn't work as the enumerator is bound to ...Show All
Erik Pedersen Update custom control at design time when property changed
Hi guys, I created a custom control SListView extending ListView. I define the SListView to hold a collection of a simple class type, which has two fields: name and id. Among the two, name should be displayed in the SListView control. Everything works fine except after I added a collection of names, the SListView control does not update its content at the design time. It will only display the names at runtime. Any suggestion Thank you! Shu ...Show All
Sambakongen Save File Dialog. (I have code, just need a little help fixing)
Hey, Ok, so I did the save FIle dialog code and it works fine. But I can't figure out how to amke it so thta is will save the contents of the current page in the webbrowser. Here is the code: private void savePageToolStripMenuItem_Click( object sender, EventArgs e) { Stream myStream = null ; SaveFileDialog saveFileDialog1 = new SaveFileDialog (); saveFileDialog1.InitialDirectory = "c:\\" ; saveFileDialog1.Filter = "Webpage Html (*.html)|*.html|Text File (*.txt)|*.txt" ; saveFileDialog1.FilterIndex = 2; saveFileDialog1.RestoreDirectory = true ; if (saveFileDialog1.ShowDialog() == DialogResult .OK) { try { if ((myStream = saveFileDialog1.OpenFile()) != nu ...Show All
Liu Hua problem with the update of the IssueVision
I downloaded the IssueVision code,and successfully installed it. it works. But it cann't update by itself. I open the c# project solution, and found that, no AppUpdater.dll added to the project. so I added the AppUpdater.dll to the MainForm.cs ,and change the version to 2.0.0.0 in AssemblyInfo.cs .then I rebuild it and the ClientInStall project. After all of this, I installed the Client side of the IssueVision. and I change the <AvailableVersion>2.0.0.0</AvailableVersion> <ApplicationUrl>http://localhost/IssueVisionDeployWeb/2.0.0.0/</ApplicationUrl> </VersionConfig> but then,after I start the Client ,an error occured ................................. Unable to auto-download the mis ...Show All
khs202968 How to deal with file system permissions when recursing file system
I am working on a module for an app the recurses the file system. As the program recurses the "C:\" drive I get the follow exception System.UnauthorizedAccessException was caught Message="Access to the path 'C:\System Volume Information' is denied." What is the correct way to deal with this exception and continue to recurse the drive thanks, Luis Thanks for the info. The following bit of code solved the problem If Not (File.GetAttributes(path) And FileAttributes.System) = FileAttributes.System Then 'Process directories End If What if the user does not have permissions for the file/directory How can I catch that thanks again, Luis You'll avoid most, if not all, of these exce ...Show All
agody Datagridview dynamically added cell contents removed after sorting
Hi all, I just started a very simple tool which should create some resource files for me. For the moment it is just a form with a datagridview and only this code: private void Form1_Load(object sender, EventArgs e) { DataSet bitmapSet = new DataSet(); bitmapSet.ReadXml("bitmaps.xml"); dataGridView.DataSource = bitmapSet; dataGridView.DataMember = "bitmap"; DataGridViewImageColumn bitmapColumn = new DataGridViewImageColumn(); bitmapColumn.Name = "bitmapColumn"; bitmapColumn.HeaderText = "Bitmap"; dataGridView.Columns.Add(bitmapColumn); dataGridView.Columns.Add("widthColumn", "Width"); dataGridView.Columns.Add("heightColumn", "Height"); for (int i = 0; i &l ...Show All
jschumann.net showing gif animation on winforms
am making a project with gif animatio over othere img am having trouble showing the animation it only shows the first frame can anybody help me with direction , article or site i found selectactiveframe but it 2 fast in for(...) and i don't know how much to wait for frame and don't know how to clear the image without clearing the hall graphics device and if i redraw i get a flicker effect witch i don't want P.S am imaging noob, what i got i got from try and error and some reading thanks THANKS AFTER SOME WORK YOUR CODE DID IT Use a PictureBox, it will animate the GIF. Check this thread ... but how do i get the othere img on picturb ...Show All
code jockey Updating public value via pop-up dialog
Dear All, I have declared a public variable in my main form. Then upon pop-up dialog I want to be able to see the public value and update in the pop-up and later the update should be able to be seen in my main form. How to do it ya Praveen, You have a question about this or what I *know* what code *I* posted ... I was asking him to post *his* code (which could very well be slightly different). In that case, you should probably do it the other way I showed, which is probably the better way to do it anyway (and the way I usually do this type of thing myself). Dear Bonnie, What are the other ways of doing it with out passing the reference to of the main form to the ...Show All
