
jccorner
Avatar/Signature-
Posts
146 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by jccorner
-
I've searched for people with this problem and haven't found an answer. I have a public shared form and when I try to show it, it blows up. if Globals.frmContact = *Nothing Globals.frmContact = frmContact New() Addhandler Globals.frmContact Closed HandlerSr(RefreshForm) Globals.frmContact.MDIParent = *this.MDIParent endif Try Globals.frmContact.Show() Globals.frmContact.Focus() Catch Name( z ) Type(System.Exception) Globals.frmContact.Dispose() Globals.frmContact = frmContact New() Globals.frmContact.Show() Globals.frmContact.Focus() EndTry I know the code is different, it's a different language, but very much similar to VB.net. If anyone has any clues I'd greatly appreciate it.
-
Would anyone have a simple way of checking to see if the shift key is down?? I want to check for say Shift and the letter I being pressed.
-
You don't necessarily need to use a class, you can just create a procedure to handle the key pressed by checking the e.KeyCode value and handle the event accordingly.
-
I had an issue where I kept getting an unhandled exception stating: "Cannot access a disposed object: TextBox" I am using multiple forms and I want to check to see if the second form is already available, if it is, bring it to the front and give it focus. Well, I was doing pretty well until I tried to close the main form. I then was receiving the error. Well, the solution I have found is to change my statement: Me.Close() to Me.Dispose(False) on the main form. My question is, what is the difference between the two?? I originally thought that when you invoke the Close method, that Dispose is called explicitly, but I am probably incorrect in this thinking. I need to know is this poor memory management or will this give me another issue to tackle later down the line?? Thank you for your time.
-
Jabe, Thanks but that did not work for me. Do you know of a way to keep the user from being able to select a cell, because the event fires when the a row is selected, but not when the user can select a cell.
-
Thanks but it didn't seem to work either. How did you go about instantiating the datagrid??
-
JABE!!!!!!!! I HAVE ICONS!!!!! YOU ARE THE MAN!!!!!!!! Thank you, thank you, thank you. Wow, I've been looking for that one for a while. Thanks. I love this forum.
-
I don't understand how that would help me. Don't get me wrong, I appreciate your help, but maybe you're misunderstanding what I'm attempting to do. I want to create an app that can be run solely by using the keyboard without any mouse intervention. One main component of the app is the use of function keys. I need to detect when a key is pressed and if it is a function key, I wish to process it accordingly, if not, then pass to the control to process.
-
Thanks, but I was still not able to get the images to appear. Funny thing is, a colleague of mine was able to get his icons to come up, we compared code and everything and nothing discernible was found. The thing was he didn't even use EnableVisualStyle to get his icons to work. So, if anyone has any other clues, please let me know, because I'm running out of hair to pull.
-
No, I tried the keypress and keydown events of the datagrid. It's funny because I also tried to check for the function key press in the Navigate method. I'm also looking into using a KeyEventHandler, but am not sure how to implement its uses. Any ideas??
-
How do I Select a null value in a bound combobox
jccorner replied to Alister's topic in Windows Forms
What happens if you set ComboBox.SelectedIndex = -1 ?? -
Does anyone have a solution??
-
I have a form in which I want to figure if a function key has been pressed. I can get it to work using KeyPreview except when there is a datagrid on the form. If a cell has focus and I press a function key, the function I designated to fire does not trigger. Public Sub PressKeyDown() Handles Me.KeyDown ...Do something End Sub Works for everything except when the datagrid contorl has focus.
-
Thank you so very much. Works great.
-
If you're using a dataset, you can write the tables to the XML file by using the WriteXMLSchema property. strSql = "Select * From Customers" DA = New OleDbDataAdapter(strSql, Connection) DA.Fill(DS, "Customers") DS.WriteXMLSchema("C:\SomeFolder\MySchema.xsd")
-
Thank you very much. It works great. I was looking for a way using the designer, not ADO so thanks. But I did run into a problem that I'm research now, how do you set the datasource for a subreport?? One of the reports has a subreport in it and when the report is shown, the main report has data, but the subreport does not.
-
Very appreciative. I'll change the code accordingly and let you know how it turns out. Again, thank you for the time and assistance.
-
No. I set the database when I create the report in design view. That's the problem. Now the report is tied to that database and I want to know, how can I dynamically change the location of the database for the report.
-
So no one else has had this problem??
-
I've looked for a solution but am not sure if I stumbled upon it or not, because it seems harder than it was when I used vb6. But I'm sure someone else has run into the same problem. I created a windows app that can be located anywhere on the client's pc. Unfortunately, I am trying to use a crystal report. Well, as I was developing it I tied the crystal report to the current location of my database. It worked fine on my pc but as soon as I tried to install it on the client's pc, the app works but not the crystal report. Why?? Because the location of the database that the report is looking for has been moved. My question, is how can I make the data source for the crystal report dynamic??
-
yeah, I tried that and it didn't work.
-
Yes, I've googled it, and yes I've searched here for it and yes, it's frustrating. Problem is, I have a form with a toolbar on it. I added the imagelist and the icons to the button collection and see the toolbar as I want it in design mode. But when I run it, the toolbar has blank buttons. The thing is, I found some supposed solutions to this problem when I googled, but it didn't work for me. This is what was suggested: Public Sub New() MyBase.New() InitializeComponent() Application.EnableVisualStyles() Application.DoEvents() End Sub I've tried moving the two application lines all over the program but to no avail. Does anyone else have a solution?? I greatly appreciate it.
-
Thanks guys. I found a better way though, someone let me know about the property SelectionChangeCommitted. This property fires only when there is user interaction with the combobox and the user "commits" the combobox to a value. Therefore it fires when the user changes values in the combobox, but not when the datasource is set.
-
First, this is written in vb.net. I have a windows form containing a datagrid and a combobox. Initially, when the form loads, the datagrid is supposed to display records for all companies and the combobox is blank. Now when someone chooses a company in the combobox (therefore changing the selectedindex), the datagrid will change to display records only for that company. The issue is this: Private Sub frmMain_Load(...) dv = New Dataview dv.Table = ds.Tables("SomeTable") dv.Sort = "Name ASC" cmbCo.DataSource = dv 'this line invokes SelectedIndexChanged End Sub Private Sub cmbCo_SelectedIndexChanged(...) Handles cmbCo.SelectedIndexChanged if cmbCo.SelectedIndex > -1 then 'Populate datagrid with records for chosen company endif End Sub Now on the initial load of the form when the datasource is set, it invokes the selectedindexchanged procedure but with the selectedindex equal to 0 and text equal to the first company in the dataview, therefore when the form loads, it loads with the company chosen instead of all of the companies. So my question is how do I keep from invoking the selectedindexchanged procedure when I set the datasource for the combobox or is there a flag to tell that the datasource was just set??
-
I may be wrong, but it seems the me that using a handler would be simpler: Public Sub FormClosed(sender as Object, e as EventArgs) ' Code to show second form End Sub ' this goes where your button closes the form AddHandler frm.Closed, AddressOf FormClosed