Visit the Ironworks Gaming Website Email the Webmaster Graphics Library Rules and Regulations Help Support Ironworks Forum with a Donation to Keep us Online - We rely totally on Donations from members Donation goal Meter

Ironworks Gaming Radio

Ironworks Gaming Forum

Go Back   Ironworks Gaming Forum > Ironworks Gaming Forums > General Discussion > General Conversation Archives (11/2000 - 01/2005)
FAQ Calendar Arcade Today's Posts Search

 
 
Thread Tools Search this Thread
Old 03-10-2003, 05:00 PM   #11
Charlie
Lord Ao
 

Join Date: March 3, 2001
Location: London, England
Age: 30
Posts: 2,021
Quote:
Originally posted by LennonCook:
How do you force a newline in a rich text box ??
A Big Hammer. Always works. Forces anything Anywhere.
__________________
[img]\"http://img.ranchoweb.com/images/ladyzekke/england1.gif\" alt=\" - \" /><br />One Love, Peace. [img]\"http://img.ranchoweb.com/images/ladyzekke/pissr.gif\" alt=\" - \" /> [img]\"http://img.ranchoweb.com/images/ladyzekke/piss.gif\" alt=\" - \" />
Charlie is offline  
Old 03-13-2003, 12:36 AM   #12
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
Ok, i`ve been fiddling round with it a fair bit, and all that seems to be wrong is it being fired at form load.
For the record, the *exact* error is -

Quote:
Run-time Error "5"
Invalid Procedure Call or Argument
Would it help you to have the .vbp and .frm files ??

[ 03-13-2003, 12:37 AM: Message edited by: LennonCook ]
LennonCook is offline  
Old 03-13-2003, 01:36 AM   #13
Djinn Raffo
Ra
 

Join Date: March 11, 2001
Location: Ant Hill
Age: 49
Posts: 2,397
Well if you want a control to have focus as soon as the form loads you could just set the TabIndex of that control to 0.

edit> you can zip and email me the files if you want.

[ 03-13-2003, 01:36 AM: Message edited by: Djinn Raffo ]
Djinn Raffo is offline  
Old 03-13-2003, 01:40 AM   #14
Djinn Raffo
Ra
 

Join Date: March 11, 2001
Location: Ant Hill
Age: 49
Posts: 2,397
OK i did some searching and the problem you are having is that the control is not visible yet.

Put these events in a new form (i copy this from a thread at deja.com) and run it.

Check your immediate pane for the debug.prints to see what is happening..

'============
Option Explicit

Private Sub Form_Activate()
On Error Resume Next
Text2.SetFocus
If Err.Number = 0 Then
Debug.Print "Form_Activate:Success"
Else
Debug.Print "Form_Activate:Failed"
End If
Err.Clear
End Sub

Private Sub Form_GotFocus()
On Error Resume Next
Text2.SetFocus
If Err.Number = 0 Then
Debug.Print "Form_GotFocus:Success"
Else
Debug.Print "Form_GotFocus:Failed"
End If
Err.Clear
End Sub

Private Sub Form_Initialize()
On Error Resume Next
Text2.SetFocus
If Err.Number = 0 Then
Debug.Print "Form_Initialize:Success"
Else
Debug.Print "Form_Initialize:Failed"
End If
Err.Clear
End Sub

Private Sub Form_Load()
On Error Resume Next
Text2.SetFocus
If Err.Number = 0 Then
Debug.Print "Form_Load:Success"
Else
Debug.Print "Form_Load:Failed"
End If
Err.Clear
End Sub
'''''''''''

[ 03-13-2003, 01:50 AM: Message edited by: Djinn Raffo ]
Djinn Raffo is offline  
Old 03-13-2003, 02:06 AM   #15
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
*slaps forehead* All I needed was to make it ignore that error, because realy it should have done it. There`s a reason, after all, that they included as part of the language "On Error Resume Next"...
LennonCook is offline  
Old 03-13-2003, 02:15 AM   #16
Night Stalker
Lord Ao
 

Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
Oh, duh! You are trying to set focus to the control from _Load. Again check out the help files. VBs help is pretty good usually. But, anyway, to sum up. Your form at the _Load event is loaded, but not visible. This means that the form object has been created, and all child objects have been created, but they are not displayed. You can access any object's properties or methods, but you can only set focus to visible objects. The place to set focus when first loading a form is the _Activate event (another place is the _GotFocus event). This is the event that fires when the form is made visible, but before it has focus. Be warned though that code here gets called EVERY time the form is made visible (switching to another application and back to this one causes this for example). If all you want to do is have a default control have focus on form load, give it a .tabindex=0. you can do this from the properties page, or in code (even in _Load).

Hope this makes some sense to you.

If you want me to look at your code, pm me.
__________________
[url]\"http://www.duryea.org/pinky/gurkin.wav\" target=\"_blank\">AYPWIP?</a> .... <img border=\"0\" alt=\"[1ponder]\" title=\"\" src=\"graemlins/1ponder.gif\" /> <br />\"I think so Brain, but isn\'t a cucumber that small called a gherkin?\"<br /><br />Shut UP! Pinky!
Night Stalker is offline  
Old 03-13-2003, 03:24 AM   #17
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
Two more questions...
1) Is it possible to automatically select the text in the textbox after you press something ??
2) I`ve been challenged and need a bit of help... anyone have ideas on how to write a program that converts between decimal and hex ??
LennonCook is offline  
Old 03-13-2003, 03:39 AM   #18
Night Stalker
Lord Ao
 

Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
1. Yes, there is a selected property of the textbox. Check help for implementation, cuz I don't have access at the moment.

2. Is this for a mental exersize? I think there may be some built in functions to help with this .... If not, remember:

A decimal number is
cn x 10^n + ...... + c2 x 10^2 + c1 x 10^1 + c0 (technically x 10^0 which is just 1)
where c has a range of 0-9.

A hex number is
yn x 16^n + ...... + y1 x 16^1 + y0
where y has a range of 0-F

Try a recurisve function that takes a long parm and returns a string. Do you see an algorithm appearing yet?

[ 03-13-2003, 03:42 AM: Message edited by: Night Stalker ]
__________________
[url]\"http://www.duryea.org/pinky/gurkin.wav\" target=\"_blank\">AYPWIP?</a> .... <img border=\"0\" alt=\"[1ponder]\" title=\"\" src=\"graemlins/1ponder.gif\" /> <br />\"I think so Brain, but isn\'t a cucumber that small called a gherkin?\"<br /><br />Shut UP! Pinky!
Night Stalker is offline  
Old 03-13-2003, 11:56 PM   #19
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
Ok, what`s a recursive function ?:|?
LennonCook is offline  
Old 03-14-2003, 12:55 AM   #20
Night Stalker
Lord Ao
 

Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
Question Mark

A function that calls itself.

ex.

code:
function Factorial(by val x as integer) as long
If x != 0 Then
Factorial = x * Factorial(x-1)
Else
Factorial = 1
End If
end function
[/QUOTE]this function will call itself until x=0 then start returning values.
If x=4,
you would have Factorial=4 * Factorial(3)

so Factorial(3) needs to be resolved before Factorial(4) ... and so on till x =0

The final result returned is 24.

Not all recursive functions are structured like this, but all need a way to break the recursion, else an infinate call happens.
__________________
[url]\"http://www.duryea.org/pinky/gurkin.wav\" target=\"_blank\">AYPWIP?</a> .... <img border=\"0\" alt=\"[1ponder]\" title=\"\" src=\"graemlins/1ponder.gif\" /> <br />\"I think so Brain, but isn\'t a cucumber that small called a gherkin?\"<br /><br />Shut UP! Pinky!
Night Stalker is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another Video Card Question becomes Antivirus Question!!! Bahamut General Conversation Archives (11/2000 - 01/2005) 19 12-27-2003 11:40 PM
One BIZZZARE question and one normal everyday question Sythe Baldurs Gate II: Shadows of Amn & Throne of Bhaal 3 09-10-2002 02:44 AM
Early ch6 question - poss spoiler info in question... Fljotsdale Baldurs Gate II Archives 5 03-18-2001 12:33 AM
Dragon spire crystal question + question about Giant killing for the warriorguild Malakez Wizards & Warriors Forum 4 02-20-2001 03:52 PM
spell lvl question, buying spells question, and role ascension question Paupa Wizards & Warriors Forum 1 12-31-2000 04:59 PM


All times are GMT -4. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved