Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=79648&
  2. try [DefaultProperty("AutoCompleteEnabled"), DefaultEvent("SelectedIndexChanged")] public class AutoCompleteComboBox : ComboBox { /// /// Event raised if a match isn't found and /// is set to true /// public event CancelEventHandler MatchNotFound; /// /// Internal value to track if we should bother auto completing or not /// private bool _AutoCompleteEnabled = true; /// /// Internal value to track if we should limit to list or not. /// private bool _LimitToList = true; /// /// Enable or disable autocomplete /// [system.ComponentModel.Category("Behavior"), System.ComponentModel.Description("Enables or disables the autocompletion functionality")] public virtual bool AutoCompleteEnabled { get {return _AutoCompleteEnabled;} set {_AutoCompleteEnabled = value;} } protected override void OnValidating(CancelEventArgs e) { if (LimitToList) { int i = this.FindStringExact(Text); if (i == -1) { OnNotInList(e); } else { SelectedIndex = i; } } base.OnValidating(e); } [Category("Behavior"), System.ComponentModel.Description("Limits the selection to items in the list.")] public bool LimitToList { get { return _LimitToList; } set { _LimitToList = value; } } protected virtual void OnNotInList(CancelEventArgs e) { if (MatchNotFound != null) { MatchNotFound(this, e); } } protected override void OnKeyPress(KeyPressEventArgs e) { string currentText = Text; int i; if (e.KeyChar == Convert.ToChar(Keys.Back) ) { if(Text.Length == 0) {return;} //Don't backspace when nothing there Text = Text.Substring(0, SelectionStart - 1); currentText = Text; SelectionStart=Text.Length; } i = FindString(currentText); if( i >= 0 ) { SelectedIndex = i; Select (currentText.Length, Text.Length); } base.OnKeyPress (e); } }
  3. try Response.Write("http://" & Request.ServerVariables["SERVER_NAME"] & Request.ServerVariables["URL"] & "?" & Request.ServerVariables["QUERY_STRING"]);
  4. The server side code you suggest would never execute as the validators would prevent the post back occurring.
  5. Does the other computer have the .Net framework installed?
  6. http://www.123aspx.com/reserr.aspx?res=31456
  7. environment.GetFolderPath
  8. You could just use some form of Source code control (Sourcesafe, cvs etc.)
  9. textbox1.text.trimstart would remove leading whitespace
  10. Is there a problem with using the control panel? If so then you will probably have to use a 3rd party tool.
  11. What are you trying to do? If the server rejects the address then there is a good chance you are trying to send e-mails either from a server you shouldn't or to a server that doesn't want your e-mails. Any chance you could give a bit more detail?
  12. Unfortunately what they want is often 'can you make it like our current paperbased | dumb terminal based | word of mouth based system' and they have no intention of participating in any constructive dialog in terms of function spec, user requirements, reporting needs etc. That is what I find most stressfull as you know they will later pick holes in everything and anything. Luckily not something I get involved in much at the moment though....
  13. PlausiblyDamp

    .exe

    number 2 is easy, add the wav to a project and set it's build action to be 'embedded resource'. At runtime you can access it through the ResourceManager class as for number 1 - why?
  14. If you are creating it yourself (sounds like you are) then as Divil said above you wil need to call the .Dispose method of the notify icon in your form's Close event. To create one from the designer - you can drag the notifyIcon from the toolbox on to a form and it will automatically take care of this.
  15. If you are inheriting the DataGrid you should automatically get all it's properties. You will only need to do that for your own properties - how are you doing them currently?
  16. http://www.datagridgirl.com/ probably has one
  17. Are you closing all your resources properly? Are you using any threading? If possible could you post some code - it makes it a lot easier for people to help if they can see what you are trying to do.
  18. http://www.visualbasicforum.com/
  19. Do as you suggested - create a Windows control library that contains your class. This could then be added to the toolbar. Is there a particular reason you can't do it that way?
  20. Dim sp As New SqlClient.SqlCommand() sp.CommandText = "stored proc name" sp.Parameters.Add("@param name", SqlDbType.Int) 'Change as appropriate sp.Parameters("@param name").Value = 47 'Change to your value
  21. You could probably do something like myDialog.Dispose(); if you really felt the urge but if you leave it alone .Net's garbage collector will get round to deleting it eventually.
  22. A memory stream allows you to use the normal .Net IO functions (StreamReader, StreamWriter etc) but on a Byte array rather than a physical storage medium. http://www.atis.org/tg2k/_initialization_vector.html
  23. You could call each method in turn and then wait i.e. BeginMethod1 BeginMethod2 'do stuff EndMethod1 EndMethod2 the EndXXXXX methods will block until the server returns a result.
  24. for the first one something like dim files() as string = System.io.directory.GetFiles("c:\") 'change as appropriate dim file as string for each file in files system.io.file.delete(file) next for the second IIRC textboxes have a password character - just set that to * and it should work
  25. Nope, the api doesn't accept floating point values - just checked in MSDN and they accept 16-bit unsigned integers and returns a 32-bit integer so I suppose the proper declaration is Private Declare Function ColorHLSToRGB Lib "SHLWAPI.DLL" _ (ByVal wHue As Short, ByVal wLuminance As Short, ByVal wSaturation As Short) As integer but as Bucky said - the 2nd and 3rd parameters are being rounded off. Where are you getting the values for the last two parameters from?
×
×
  • Create New...