Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You could provide a public function in each form which reloads the data and call this from your for...each loop. This approach could cause a lot of database activity and network traffic though if you have lots of users with lots of forms refreshing too frequently.
  2. Using an array of parameters can be handy if you really don't know how many parameters are going to be provided, however it may require a lot of runtime type checking and casting if you only pass them in as objects. Overloads allow you to define several version all of which are strongly typed and generate sensible tooltips in the IDE to make it easier for developers to see the names and types of parameters involved. I personally prefer overloaded functions and tend to follow the MS standards of providing overloaded functions for 1,2 or 3 optional parameters and if more are required also providing a version that accepts an object array. eg see Console.WriteLine and it's overloads involving one, two, three and many objects.
  3. Could you not use a wizard style, with a previous and next button and a point by point guide to let the user now how far they have progressed? Divil has quite a nice wizard component on his web site http://www.divil.co.uk/net/controls/wizardcontrol/ that is pretty easy to use.
  4. did you try the code I posted earlier? Dim s As String = "TextBox1" Dim t As TextBox Dim c As Control For Each c In Me.Controls If c.Name = s Then t = c Exit For End If Next
  5. Could you not remove the tabpage in question instead of disabling it? I've had to do it that way myself before now, annoying that even visible = false doesn't work on a tabpage either.
  6. How is Form1 declared? You posted the code for the findTextForm and editor but not Form1.
  7. Not that I'm aware of (doesn't mean there isn't). however you could check to see if x and y contain strings or integers and use the appropriate compare routines. if typeof x is string and typeof y is string then 'Do string compare end if if typeof x is integer and typeof y is integer then 'Do integer compare end if
  8. PlausiblyDamp

    union

    unions aren't supported in c# - use either a struct or a class depending on your needs.
  9. Where is Form1 declared?
  10. If every button needs to do something different then you are probably better going with one click event per button. If multiple controls require the same (or simialr) event processing then code like the above snippet can be quite useful. Really boils down to if it works here - use it here, if not - don't.
  11. It will create a new instance of IE on the ASP.Net server running under the ASPNET account which will not be visible to the user. What are you trying to do - there may be an alternate way.
  12. You could add the handlers in code as an alternative Private Sub Buttons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MessageBox.Show("dsfsdf") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim c As Control For Each c In Me.Controls If TypeOf c Is Button Then AddHandler c.Click, AddressOf Buttons_Click End If Next End Sub
  13. Could you show us a bit more of the code in Form1 and the search form?
  14. Form1 inherits from Form1??? If so that is the problem - everytime you create a new form1 and call it's base constructor it's calling itself. shouldn't Form1 inherit from Form?
  15. Could you post the code in question?
  16. Instead of casting the items to strings could you not convert the subitems to integers and then do the comparison. not exactly sure of your requirements but something like the following may be a starting point. Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _ Implements IComparer.Compare Dim lv1, lv2 as ListViewItem lv1 = directcast(x, ListViewItem) lv2 = directcast(y, ListViewItem) if integer.parse(lv1.SubItems(col).Text) > integer.parse(lv2.SubItems(col).Text ) then return 1 if integer.parse(lv1.SubItems(col).Text) < integer.parse( lv2.SubItems(col).Text) then return -1 return 0 End Function
  17. Still not sure what you mean. Given a string TextBox1 do you want to find an existing textbox or create a new textbox?
  18. What class does Form1 inherit from and what is in ir's Sub New?
  19. What code do you have at he moment for the comparison? It may be quite easy to convert.
  20. The form has a minimumsize and maximumsize property - they are probably the easiest way.
  21. http://www.go-mono.com/mbas.html - there already exists a 3rd party VB compiler. A lot of work still needs to be done though....
  22. What errors did you get? If you are calling the eventhandler for a list box you will need to pass in the two required arguments.
  23. Dim s As String Dim c As Char = """" s= "enter string here" Dim i As Integer = s.IndexOf(c)
  24. Just double up the " symbol Dim s As String s = "Hello ""World""!!!!"
  25. Build menu -> build solution. Also whenever you run your app in the debugger it gets compiled. If you look in the folder where your app's code is located there should be a folder named bin. The executable should be in there.
×
×
  • Create New...