Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Private Sub Menu_Users_Selected_Row_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Menu_Edit_User.Click 'Want to know which submenu that is clicked on Dim m As MenuItem m = DirectCast(sender, MenuItem) 'Can now access m.Index or m.Text to identify menu item End Sub Hope that is of some use.
  2. Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick End Sub replacing TextBox1 with the name of your control. If you are using Visual Studio you should be able to go to the code for the form, select the textbox in the drop down list on the top left of the code window and then the event in the drop down on the top right of the code window
  3. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconworkingwithmultipleversionsofnetframework.asp might be of some use
  4. Is there a reason why you are adding the validator in code rather than the designer?
  5. Explorer has a tendancy to round numbers up to the nearest 1K or 1M depending on size. The two bytes are probably a CRLF or something similar.
  6. if you bring up the property page in explorer for one of these 1k but empty files what does it say about the file size there?
  7. Really not keen on it in outlook, it makes the group headers seem about twice the size of the office xp / 2000 ones.
  8. Why not just have 1 table containing both the questions and answers?
  9. If you are using the VB.Net TreeView it has undergon some changes since the VB6 version. The new type is 'TreeNode'
  10. Skipped naming the buttons because I'm lazy (seriously). Also Mutant's idea of having your own collection is a good one as it saves you having to iterate through ALL the controls on a form to find the dynamically generated controls. The addhandler command is very powerful in this respect as it will allow you to declare event handlers at compile time and actually only wire up what is needed at run-time. See modifications below Private Buttons(9) As ButtonTextBox 'Put in the form declarations section Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim b As Button Dim i As Integer For i = 0 To 9 b = New Button b.Location = New Point(10, i * 25) b.Text = i b.Name = "btn" & i.ToString() 'New line here Me.Controls.Add(b) TextBoxes(i)=b 'New line here AddHandler b.Click, AddressOf ButtonClick Next End Sub Private Sub ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) Dim b As Button b = DirectCast(sender, Button) MessageBox.Show(b.Text) End Sub I always code with Option Strict On so just using sender.Text will generate an error. The DirectCast is basically converting the generic sender object into a Button object - gives compile time checking of methods, events etc. The link dynamic_sysop gave explains it better than I could...
  11. Was the longs rather than integers a vb6 tip? Under VB.Net an integer is 32-bit (on a 32 bit OS anyway) and a long is now 64 bit.
  12. Rough and ready but should give you the idea of how to add controls dynamically just paste into the code behind a blank form Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim b As Button Dim i As Integer For i = 1 To 10 b = New Button b.Location = New Point(10, i * 25) b.Text = i Me.Controls.Add(b) AddHandler b.Click, AddressOf ButtonClick Next End Sub Private Sub ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) Dim b As Button b = DirectCast(sender, Button) MessageBox.Show(b.Text) End Sub
  13. It's a Monday - I should know better than being helpful before 5 or 6 cups of coffee ;)
  14. Just out of curiosity what are you trying to do? The problem is probably that the system is trying to run IE as the aspnet user on your system which may not have access to IE or the default homepage.
  15. Just tried it here and the password character did display correctly according to the alt+249 code from Character Map. However typing ALt+249 into a textbox didn't display the same character.
  16. dim x(14,20) as
  17. Probably a luck escape! The migration wizard is less than fantasic. (I'd say less than useful to be honest)
  18. the msdn link http://ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemwindowsformscursorclasstopic.htm seems to indicate only Black and White.
  19. That was taken from a VB.Net app but it should work in C#. Actually Environment.GetFolderPath(Environment.SpecialFolder.System) (case sensitive in C#)
  20. = NULL will always return NULL. Probably the easiest way is alter the SP so that you check for NULL and act accordingly i.e. Create proc . . . . AS if @Qualifier is NULL Begin --Code to handle NULL here select * from table1 where curve=@Curve . . . AND Qualifier IS NULL End Else Begin --Non Null here select * from table1 where curve=@Curve . . . AND Qualifier = @Qualifier End
  21. environment.GetFolderPath(Environment.SpecialFolder.System) will return the path to the system folder. BTW: a LOT of people will go looking in system32 - so it isn't a good place to store unencrypted passwords. You are better looking at the System.Security.Cryptography namespace and using one of the classes in there to store a hash of the passwords.
  22. What exactly do you get in parts(0) when parts(1) gives an error. Any chance you could give an example of the data you are working with?
  23. Easiest way is to store the config settings in a user defined class and mark it as serialzable (makes reading / writing to a stream very easy). Then store this in a sub-folder of the user's Application Data folder -you can obtain the path to it by environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
  24. Not exactly sure what you are trying to do there. Because you are doing the .Text assignments within the While drItems.Read loop it will overwrite the contents repeatedly till the loop exits. The last record will be the one that is displayed.
  25. IIRC Dispose will not be called automatically when the program exits. however if you override the finalize method in a class this will automatically be called (sometime after the object goes out of scope and before the application terminates). MS info on the subject... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconfinalizedispose.asp also http://www.vbinfozine.com/a_disposable.shtml has an idea or two. if you are using C# though a new keyword 'using' can be used. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_8_13.asp this will call the Dispose method automatically
×
×
  • Create New...