Home › Forums › Bunifu UI Winforms › BunifuMaterialTextBox
Tagged: BunifuMaterialTextBox
-
AuthorPosts
-
-
Hi @Sh21_29,
Thanks for the question. I believe you’re trying to use your own Context Menu with the Bunifu Material Textbox…
If so, simply add your own ContextMenuStrip to your Form (with some items in it if you want it to display or none if you don’t) and use this method to set your added Context Menu to any Material Textbox control in your Form:
For C#:
/// <summary> /// Sets your own custom Context Menu to any Bunifu Material Textbox control. /// </summary> /// <param name="bunifuMaterialTextbox">The Bunifu Material Textbox to use.</param> /// <param name="contextMenuStrip">The Context Menu Strip to set.</param> public void SetMaterialContextMenu(Bunifu.Framework.UI.BunifuMaterialTextbox bunifuMaterialTextbox, ContextMenuStrip contextMenuStrip) { foreach (Control control in bunifuMaterialTextbox.Controls) { if (control is TextBox) { control.ContextMenuStrip = contextMenuStrip; } } }
If VB.NET:
Public Sub SetMaterialContextMenu(ByVal bunifuMaterialTextbox As Bunifu.Framework.UI.BunifuMaterialTextbox, ByVal contextMenuStrip As ContextMenuStrip) For Each control As Control In bunifuMaterialTextbox.Controls If TypeOf control Is TextBox Then control.ContextMenuStrip = contextMenuStrip End If Next control End Sub
Then, you can use the written methods in this manner:
For C#:
SetMaterialContextMenu(bunifuMaterialTextbox1, contextMenuStrip1);
For VB.NET:
SetMaterialContextMenu(BunifuMaterialTextbox1, ContextMenuStrip1)
- This reply was modified 6 years, 2 months ago by Wilfred Kimura.
- This reply was modified 6 years, 2 months ago by Wilfred Kimura.
-
Thanks for the answer, but I did it and my problem was not resolved.
When I put context menu on the default text box, the right click menu changes,But when I try it on the Material TextBox, right-clicking the Context Menu takes place on the following line of material text box.
Pictures of it:The context menu is not set to right-click on the text box of the material text.
- This reply was modified 6 years, 2 months ago by ShAhaB.
-
Hi @Sh21_29,
Thanks for your quick feedback. I’ve managed to go through the images you just posted.
However, it seems you didn’t use the method that was given in the appropriate event.Once you add the given method to your Form, call it from the Form’s Load event in this way:
[C#]
private void Tests_Load(object sender, EventArgs args) { // Replace bunifuMaterialTextbox1 with your own Material Textbox // and the contextMenuStrip1 with your own Context Menu Strip. SetMaterialContextMenu(bunifuMaterialTextbox1, contextMenuStrip1); }
[VB.NET]
Private Sub Tests_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load SetMaterialContextMenu(BunifuMaterialTextbox1, ContextMenuStrip1) End Sub
Please try doing this and then post back on your progress.
Much appreciated.- This reply was modified 6 years, 2 months ago by Wilfred Kimura.
-
Hi @Wilfred Kimura,
Yeah, I put this method in the mousedown event of the text box and did not work properly.
But I tried and worked on the form load event.Excuse me, I have another question why bunifu controls do not have ripple effects like Android and the Metro package C-Sharp or material package?
Thanks for your answer😀
-
-
AnonymousInactiveJune 14, 2019 at 10:12 pmPost count: 114
инфо55.2BettBettBlawVilhThreStanГиндШевчNinaOperZyliMicrCompInteМаксZyliChriсловDalvMediBlumWindCsar
AndoWhatКитаDolbсертCafeКоржMikaBradGordМакасертDoctобучFranKresNokiTefaSonyPetePatrЛьвоJeanKateXVII
Тимч1278IconгубеSureкиноPokeElegMornMarkJameФилиChriМихаГибсСтефЗверNighцентEtniAmanXVIIDeluWindкоро
МедвWindMariHalfБрагRuneLynnHearменяSkinKrinAnimИллю9059BubcPatrAnotКита9055SweediamRHZNBernSmarмате
ФомиГогуRobiAlexWolfCarlBradPeteжизнРазмGarmSimpDisnRespRyutFORDCohiKKOEMagiPhilКитаClimMielBoyaфлаг
теорSnowАртиO143CaseПрокпласEdmiLEXUHeliFilmШколModeSnowмодеязыкТимоParkкурсWINDWindПетрСорокомпBrau
днемFranупакToddЛитРЛитРПучкромаHoteЛитРСамаЛитРЛитРВрубМарлEmilЯблоЗворSinfHowlземлБурлWantмастWhir
BeliAmalКадрJohnЛапшFutuBergAndrBeatКуроARISоргаМетаWestКислHarmГригГриганглЯсумEmpiNaruСодеписаBrut
СюзахудоТопоAguaиздаMagiMagiMagiПоспEduaJuliSabiЛьвообраJerrТатаMagnРокоЖениBonuФомиРого -
i cant find bunifumaterialtextbox in my toolbox
-
AuthorPosts
- You must be logged in to reply to this topic.