BackblazeB2: Remove SetPlaceHolderText() and use SetWatermark()

This commit is contained in:
tinybarks 2018-10-01 17:58:53 +02:00
parent 140d583a1c
commit b0c1a21c27
No known key found for this signature in database
GPG key ID: D999045C35D5795A
2 changed files with 2 additions and 18 deletions

View file

@ -124,7 +124,8 @@ private void InitializeControls()
cbCustomUploaderResponseType.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<ResponseType>());
// Backblaze B2
SetPlaceholderText(txtB2Bucket, "Optional, only used if you didn't set a bucket when you made the key");
txtB2Bucket.HandleCreated += (sender, e) =>
txtB2Bucket.SetWatermark("Optional, only used if you didn't set a bucket when you made the key", showCueWhenFocus: true);
#if DEBUG
btnCheveretoTestAll.Visible = true;

View file

@ -1576,22 +1576,5 @@ private void ConfigureOAuthStatus(OAuthControl oauth2, bool result)
}
#endregion Generic OAuth2
#region Miscellaneous
/// <summary>
/// Adds or replaces placeholder text in a text box without affecting the content (<c>.Text</c>) of the
/// text box.
/// </summary>
/// <param name="textBox">The TextBox to operate on.</param>
/// <param name="text">Text to display to the user.</param>
public static void SetPlaceholderText(TextBox textBox, string text)
{
// https://stackoverflow.com/a/22405509
const int EM_SETCUEBANNER = 0x1501;
NativeMethods.SendMessage(textBox.Handle, EM_SETCUEBANNER, 0, text);
}
#endregion Miscellaneous
}
}