Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change de default icon in a form in Paradox 9

Status
Not open for further replies.

serarmoro

Programmer
Dec 18, 2002
16
0
0
MX
I want to change the default icon in a form in order to put my client's one.
 
Can you be more specific? What do you mean by 'in a form'? Are you talking about button icons, shortcut icons, or what? Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Thanks, for answering, the icon I want to change is the one that appears BESIDE THE WINDOW TITLE in a form
 
I don't think you can change that from within Paradox. The Windows API might have some clue about how to make a change, since I believe it is default Windows behavior to use the icon embedded in the programs executable file for that image. Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
serarmoro,

Actually, Mac hasn't had enough coffee, for he's forgotten about the setIcon() method, which lets you change icons for forms, reports, and the Paradox desktop.

Example:
Code:
 var
      frm  Form
   endvar

   const
      FILENAME = "c:\\iconpath\\myicon.ico"  ; adjust as needed
   endConst

   frm.attach()
   frm.setIcon( FILENAME )

Hope this helps...

-- Lance
 
I didn't know about seticon() either<g> Whilst we are in that corner of the form etc does anyone know how to get rid of these [brackets] around the title of the form set with settitle() on form open?
 
Nope Lance, I never even knew about it. I usually only learn things when I need them or they blow up in my face :)

Thanks for the tip.

Mac :)

&quot;There are only 10 kinds of people in this world... those who understand binary and those who don't&quot;

langley_mckelvy@cd4.co.harris.tx.us
 
lencarne,

Brackets? I don't see any brackets in my forms (Paradox 9), but seem to recall that older versions would place brackets in form titles by default. I think that behavior disappeared pretty early, though I may be mistaken.

In any event, you can change a form's title using something like this in open():

Code:
method open(var eventInfo Event)

   if eventInfo.isPreFilter() then
   ;// This code executes for each object on the form
		
   else
      ;// This code executes only for the form
      doDefault
      setTitle( &quot;Whatever you want&quot; )		
   endIf

endMethod

So, expanding on this, something like this should delete brackets found in form titles:

Code:
method open(var eventInfo Event)
var
   strMatch,
   strTitle  String
endVar

	if not eventInfo.isPreFilter() then
      doDefault
      strTitle = getTitle()
      if strTitle.match( &quot;[..]&quot;, strMatch ) then
         setTitle( strMatch )
      endIf
	endIf

endMethod

I did notice one thing with this approach. You need to use separate string variables for the match. While Paradox/DOS let you reuse string variables with match(), it appears that PdoxWin needs separate string variables. Go figure.

Mind you, I'd rather see you use the form's init() event, but that wasn't added until Paradox 7, if memory serves.

(BTW, setIcon was added in version 7.)

Hope this helps...

-- Lance
 
I get Paradox 10-[Project Viewer] if project viewer or any window/form is maximised. The [] disapear if not maximised. I will try your code anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top