Jump to content
Xtreme .Net Talk

sjn78

Avatar/Signature
  • Posts

    258
  • Joined

  • Last visited

Everything posted by sjn78

  1. Why not have a look at the listview control. It is much better for displaying data in columns. With the right settings, it can also look like a grid view.
  2. I have nearly finished my program and I am now looking over it to clean up any rubbish and trying to make things runs a little quicker. I have a few global variables that hold options for the program. These options are read in when the program launches. Would it be better to only read the options in when they are required or to keep it the way i have it. I guess having global variables will use more memory than if I didn't have them. The second part of my quiestion is this. I have a few functions in a module to retrieve the ID of a person in the databse. I would like to turn this into a class but am a little unsure on how to do it. This is what I have in the module. Function GetNameID(ByVal fname As String, ByVal lname As String) Dim nameid As Integer If fname = "NULL" Or lname = "NULL" Then Return 0 End If Dim sql As String = "SELECT ID, Surname, Firstname FROM Contacts " & _ "WHERE Surname = '" & lname & "' AND Firstname = '" & fname & "'" Dim objDsName = New DataSet() Dim objDaName = New OleDbDataAdapter(sql, cnstring) objDaName.Fill(objDsName, "TempName") For Each objrow In objDsName.tables(0).rows nameid = objrow("ID") Next objDsName.dispose() objDaName.dispose() Return nameid End Function Now how would i implement this into a class. Thanks for any help or advice Steve
  3. Perfect!! Thanks for that
  4. I have a small form with a single textbox for data entry. I have got it so when you hit escape it closes the form. Using the below code, the system 'BEEPS' when this is done. How can I do this so there is no 'BEEP' Private Sub frmAddResult_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress If Asc(e.KeyChar) = 27 Then GC.Collect() Me.Close() End If End Sub Thanks Steve
  5. I think that is what was happening. I put a picture box on the tab, then on the picture box paint event i drew the lines. This works. Thanks
  6. In VB6 when you created an installation setup, it would find out whether you were using a database or something like that. It would then let you pick the type of connection you used so that you could package the drivers with it. Does .NET do this or would I need to find the files myself and register them on installation. It is an Access database. The other alternative I guess is to have access runtime installed on the computer, but are there redistribution issues with that? Thanks Steve
  7. Trying to draw a simple line on a form and cannot figure out where I am going wrong. I have done this when I send a doc to print, but the same method isn't working. I have a form with tabpages on it. On one of the tabpages I have a Picture Box where I want the line to be. Dim PSNormal As New Pen(Black, 1) Dim g As Graphics = Me.pb.CreateGraphics g.DrawLine(PSNormal, 5, 50, TabPage5.Width - 5, 50) Also, this is in a function in. Could that be the reason it is not working?? I can create a label on the fly and have it appear, just not the line. Thanks
  8. I have just setup my program using the XP theme support. Its all working except..... My buttons had images on them, eg Delete had Delete text and an image as well. When I change the button style to system, I lose the image. Is it possible to have an image on he button using the system style or isn't it possible? Thanks
  9. sjn78

    Classes

    Are there any good places on the web that have good examples and help on classes. I have seen what classes can do and not too experienced in them, and I want to start using them....if I knew the ins and outs about them, what they can achieve etc. I have looked at microsoft and they had an example but they didn't really say why they did it a certain way. Thanks
  10. I was reading some of the forums and came across a good idea with keeping snippets of code that you use or may find usefeul in a database. I want to have a Rich Text Box with the code samples there, but would also like to have the proper formatting for code. eg, different colours for keywords etc. Is there a file anywhere that has a list of keywords or similar that I could incorporate into the rich text box. Thanks
  11. I am new to ASP.NET and I have a few questions about it. What is the idea behind it. I mean is it a program you can write that can be accessed via the web? Or is it an advanced type of webpage that is written in one of the .NET languages. Also, I have VB.Net Standard. Can anything be created with this version or do you need Studio.NET to do this stuff. I also read something about needing XP Pro to do this sort of stuff. Thanks
  12. I have a listview which looks like this: COL1 | COL2 1 | personA 2 | personB 3 | personC I also have an up and down button so the user can click on a person and move him up or down the list like below. COL1 | COL2 1 | personB 2 | personC 3 | personA I have read a few places about sorting ascending or descending, but this is a little different. Can I take listview item 0 and place it in position 2 or wherever it needs to go. I could always take the contents out to an array and then then move the items around then put them back in the listview. Just checking to see if I have missed a simple way. Thanks
  13. I was pulling my hair out for ages trying to get it to work. I had my sub forms Window State set to maximized (thinking it would fill the entire panel) and it wouldn't work. I changed them to normal and it goes fine. Sneaky little things........
  14. Thats good you have solved it. I was thinking about this and I thought running your first query and storing the client id's in an array or single variable and then basing your second query on that variable to pull out the required records.
  15. Thanks for that. I will have to look for an alternative method.
  16. Is there a reason why there are 2 databases?? Wouldn't it be easier to have everything in the 1 database?
  17. Has anyone compacted an access database through an app? I have looked around for ages and haven't come across a method that will do it. VB6 use to do it and I guess .NET should too. If anyone knows, could you put up a sample for me. Thanks
  18. Umm......I havn't ventured into overrides yet. Will this override be in the main form or in the form being displayed in the panel? Is it possible to give me what should be in the sub to perform this? Thanks
  19. I found how to do it on another website. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form2() frm.TopLevel = False Panel1.Controls.Add(frm) frm.Show() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Panel1.Controls.Clear() End Sub This works for me, but only problem I have is on resize, the form on the panel will not move with the panel size. I have tried anchoring and docking, but none will work
  20. I am a confused about what it is you are doing. Do you have 2 forms, Form A has a panel and within that panel FormB is shown? If this is the case, let me know as I am would like to know how it is done.
  21. Create your own font and set it up with your own kerning size. Do a search on the internet for font editor. Most are 30-day trials, but you can get it done within those 30 days. http://www.high-logic.com/fcp.html This a a fully working version, but 30 days only.
  22. You could always use the validated event to grab the users input and then loop through each item in the list and if it doesn't match, give a message box saying its no good and clear the text.
  23. Download some icon software that extracts the icons from the exe then use the extracted icon in an image list. Or do you mean dynamically use the icon from the exe?
  24. It worked...sort of. The exe was about 780, and now it is 580 after converting to GIF's.
  25. Thanks, I will try converting the icons to Gif's first of all and see how it compares.
×
×
  • Create New...