Skip to main content
gamedev.net
🔒 Locked

Adding a custom button

Started by sumit381 0 replies 450+ views
Original Post
sumit381
sumit381
I am developing an app using VS05, C#, and the Feb 07 directx sdk. I am looking at the CustomUI sample included with the sdk and I would like to use a button on my app. I don't need the whole GUI, just one button on top of my app. I am using this code but I don't see any results. private void CreateUI() { hud.SetLocation(0, 0); hud.SetSize(100, 100); sampleUtility.Button playBtn = hud.AddButton(0, "Click Me", 1, 1, 20, 20); playBtn.Click += new EventHandler(clickBtnOnClick); hud.SetControlEnable(0, true); } private void clickBtnOnClick(object sender, EventArgs e) { this.Text = "You clicked the button."; } The CreateUI() method is called in my Render function after my device.BeginScene() statement. Can anyone please help me to display the button. I tried working through the CustomUI sample code but I couldn't really figure it out. Thanks for you help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.