![]() |
[Feature] Open/Close ChatBox - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [Feature] Open/Close ChatBox (/showthread.php?tid=2157) |
[Feature] Open/Close ChatBox - Mattyw - 21-09-2008 Difficulty: 0/5 - Very easy to add/use. Functionality: Made for MS4, good for if TextBox is on the GameScreen(kind of). Go into frmMirage, & look for "Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)", then add this in: Code: If KeyCode = vbKeyReturn Then It's amde so when you press Enter, it opens. If you press enter with a message, ChatBox stays open, if you press Enter without a message it closes. ENJOY! Re: [Feature] Open/Close ChatBox - GIAKEN - 21-09-2008 Would this interfere with pressing enter to send a message? Re: [Feature] Open/Close ChatBox - Jacob - 21-09-2008 Code: If KeyCode = vbKeyReturn Then Re: [Feature] Open/Close ChatBox - GIAKEN - 21-09-2008 Code: If KeyCode = vbKeyReturn Then Re: [Feature] Open/Close ChatBox - Nean - 21-09-2008 Code: ' lol I added a comment Re: [Feature] Open/Close ChatBox - Anthony - 21-09-2008 How about adding a frmMirage.Height = blah blah so that it shrinks/enlarges the form when you open/close it. Re: [Feature] Open/Close ChatBox - Mattyw - 21-09-2008 I have it ontop of my GameScreen, so I'll leave for the PUBLIC to modify. =-p EDIT: Updated: Code: If KeyCode = vbKeyReturn Then If you entered something, ChatBox stays open, if you entered nothing, it closes. Re: [Feature] Open/Close ChatBox - skillzalot - 22-09-2008 I don't know if it was your code or mine but every time txt.Text showed up I got Variable not defined so I changed all the txt.Text to txt.Chat and it installed properly so My code looks like this Code: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Re: [Feature] Open/Close ChatBox - Mattyw - 22-09-2008 skillzalot Wrote:I don't know if it was your code or mine but every time txt.Text showed up I got Variable not defined so I changed all the txt.Text to txt.Chat and it installed properly so My code looks like thisChange/remove txtText, forgot to remove from tut, I used that, but removed & changed with a Dropdown list. Re: [Feature] Open/Close ChatBox - Clu - 22-09-2008 wouldnt this interfere with enter to pick up items? (assuming enter is pick up items) Re: [Feature] Open/Close ChatBox - Mattyw - 22-09-2008 Clu Wrote:wouldnt this interfere with enter to pick up items? (assuming enter is pick up items) Could, it's why I changed my Pickup to SpaceBar. =-p Re: [Feature] Open/Close ChatBox - Acruno - 17-02-2009 Apologies for the necro but I had a look at this and it doesn't work anymore. In HandleKeyPresses Code: If LenB(ChatText) = 0 Then change that little bit to Code: If LenB(ChatText) = 0 Then |