|
-
Apr 15th, 2003, 01:29 AM
#1
Thread Starter
Member
4 General Beginner questions!
1. When a form is loaded, the window is positioned: Top = XX Left = XX. I want to position it like this:
Top = 10
Right = 10
I couldnt find any property by which I can do this. I thought if I could do this by doing it like this:
Top = 10
Left = The number equal to (800 -10 - Width of form)
It did the trick but I wonder if it will work on a machine with display settings "640 x 480" or ""1024 x 768"?
2. I have set the border to None so that there is no title bar. I have the caption set to "Something". Now "Something" appears on the taskbar when the form is loaded. I want to make it appear like the caption of other windows appear in the task bar i.e. like "a small icon + Something". I searched the properties and found the Icon property. But when I set an Icon to that property it does not appear in the task bar. Is there any other property? How can I do this?
3. I have 4 buttons on my form that are working as Tabs. So tat when the user clicks on a tab, the relevant Tab info will be displayed. How can I make appear the different Tab info when a user switches on to a different Tab.
I solved it like this; by making 4 frames and putting the contents of each Tab into the relevant frames. Then I made the 1st frame Visible = True and the remaining 3 Visible=False. Then on each button I put the event to make the relevant frame Visible=True and the remainig frames Visible=False.
Is the above method the right way? But it makes managing the frames really hard because in the design mode all the frames are piled one above the other and it is realy hard to edit the frames. How to solve this??
4. I have a form with signin button and username and password text boxes on it. I want that when the user puts the data and clicks on the button, the button and textboxes disappear and a small animation starts (as it does when you sign in to the MSN messenger) and when the sign in is successful the animation stops and the Tree View of contacts appear. Suppose I have that animation as a .Gif file or an .swf (flash) file. How can I do this?
Thanx for being so patient to read all these questions. It would be very kind if you people help me out. Thanx in advance!
-
Apr 15th, 2003, 01:37 AM
#2
Fanatic Member
Re: 4 General Beginner questions!
Originally posted by Skill Jaan
1. When a form is loaded, the window is positioned: Top = XX Left = XX. I want to position it like this:
Top = 10
Right = 10
I couldnt find any property by which I can do this. I thought if I could do this by doing it like this:
Top = 10
Left = The number equal to (800 -10 - Width of form)
It did the trick but I wonder if it will work on a machine with display settings "640 x 480" or ""1024 x 768"?
2. I have set the border to None so that there is no title bar. I have the caption set to "Something". Now "Something" appears on the taskbar when the form is loaded. I want to make it appear like the caption of other windows appear in the task bar i.e. like "a small icon + Something". I searched the properties and found the Icon property. But when I set an Icon to that property it does not appear in the task bar. Is there any other property? How can I do this?
3. I have 4 buttons on my form that are working as Tabs. So tat when the user clicks on a tab, the relevant Tab info will be displayed. How can I make appear the different Tab info when a user switches on to a different Tab.
I solved it like this; by making 4 frames and putting the contents of each Tab into the relevant frames. Then I made the 1st frame Visible = True and the remaining 3 Visible=False. Then on each button I put the event to make the relevant frame Visible=True and the remainig frames Visible=False.
Is the above method the right way? But it makes managing the frames really hard because in the design mode all the frames are piled one above the other and it is realy hard to edit the frames. How to solve this??
4. I have a form with signin button and username and password text boxes on it. I want that when the user puts the data and clicks on the button, the button and textboxes disappear and a small animation starts (as it does when you sign in to the MSN messenger) and when the sign in is successful the animation stops and the Tree View of contacts appear. Suppose I have that animation as a .Gif file or an .swf (flash) file. How can I do this?
Thanx for being so patient to read all these questions. It would be very kind if you people help me out. Thanx in advance!
1. If the units are set to "Twips" then the form will show at the same location on any resolution
2.Go to forms Icon property and select an icon from your system (max 32x32) ..If you want to set an icon for project.... go to project properties and set the icon to the above forms icon
3.That is a right way for tabs... but you can make your form big one and arrange all the frames so that you can edit them.. and use forms move method during form load event to place them correctly
4. Som'ne could answer this.....I'vent worked on Anim!!!! Gucd luck
-
Apr 15th, 2003, 01:41 AM
#3
1 Much puzzle, someone on the forum know the answer, I don't, I always puzzle until it works and look fine.
2 To do that the form must have a border, in which you cna set an icon, which will appear in the taskbar
3 Use the focus and the unfocus events, to know where the user is looking on you form
4 Search this forum, many examples are given before
-
Apr 15th, 2003, 02:14 AM
#4
1. I guess the numbers you supplied are in pixels, while the form's left and top properties work with twips.
VB Code:
Private Sub Form_Load()
Me.Top = 10 * Screen.TwipsPerPixelY
Me.Left = Screen.Width - (Me.Width + (10 * Screen.TwipsPerPixelX))
End Sub
2. Skill Jaan already told this, but to explain it a bit further: The taskbarbutton shows an icon if the form shows an icon. With borderstyle set to none, the form doesn't show an icon, so the taskbarbutton won't either. Maybe there is a solution to this with an API call, but I don't know it.
3. I would suggest to use an SSTab control (microsoft tabbed dialog control). This works much easier.
4. There is a dll around (I believe it is called gif89.dll) that can be used to show an animated gif. Search the net for it, I am sure you will find it. Another option is to use a webbrowser control (microsoft internet controls), but i think that is a bit of overkill.
To show a flash movie, you can use the Shokwave Flash control.
-
Apr 15th, 2003, 07:26 AM
#5
Thread Starter
Member
1. The form's Top and Left properties are already in Twips, so problem solved! Thanx Frans C By the way How many Twips are there in 1 pixel?
2. When I set the border to 1 , and add the icon, it still doesnt show in the title bar nor the taskbar because the Controlbox is set to false. When I set it to false the icon appears when the border is set to 1. But I wanna keep the border = 0 and still show the taskbar Icon. There must be a way man!
3. Thanx sridharavijay I will manage it now.
4. I guess I shall use the .swf file cuz I dont wanna go into that .dll thing. How much does an animation in .swf format increase the size of the file as compared to the .Gif?
-
Apr 15th, 2003, 07:43 AM
#6
A pixel is normally 15 twips.
You shouldn't use the form width with your calculations since that include the form border, and you can never be sure how large this border is. Height is even worse since that include the Title bar and menu bar (if present). Always use ScaleWidth or ScaleHeight.
-
Apr 15th, 2003, 07:48 AM
#7
Thread Starter
Member
Thanx
Originally posted by Joacim Andersson
A pixel is normally 15 twips.
You shouldn't use the form width with your calculations since that include the form border, and you can never be sure how large this border is. Height is even worse since that include the Title bar and menu bar (if present). Always use ScaleWidth or ScaleHeight.
Thanx for the advice, but that doesn't matter in my project cuz the border is set to 0 and there is no Title bar nor Menu bar.
By the way is that the only difference between the Width and ScaleWidth properties?
-
Apr 15th, 2003, 07:55 AM
#8
No, a forms width and height are always messured in Twips while the ScaleWidth/Height are messured in whatever you've set the ScaleMode property to. Personally I would use the ScaleXXX properties even if the form doesn't have any border so you don't have to change your code if you at a later point would change the ScaleMode for some reason.
-
Apr 15th, 2003, 07:57 AM
#9
The number of twips in a pixel depend on the font settings in windows. Normally this is 15, but with large fonts I believe it is 12, and with custom format this can be any value. You better don't hardcode it into your app, but use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY.
It is rediculous to say that you shouldn't use the Width and Height properties of a form, and should always use the ScaleWidth and ScaleHeight properties instead. Use the properties that give you the information you need. There is a use for both. In this case you want to know the width of the window (including borders), so you need the Width property and not the ScaleWidth property. Sorry Joacim, but in this case the scalewidth and scaleheight properties are useless.
-
Apr 15th, 2003, 08:08 AM
#10
Originally posted by Frans C
In this case you want to know the width of the window (including borders), so you need the Width property and not the ScaleWidth property. Sorry Joacim, but in this case the scalewidth and scaleheight properties are useless.
That's not really true, because he want to position a control on the form according to the width. A control can only be placed on the client part of the form and the ScaleWidth/Height messures that, not the Width or Height properties. In this case he uses a borderless form with the ScaleMode set to Twips so that means the Width and ScaleWidth returns the same value, but that doesn't mean that using the Width property of the Form to position controls is the correct property to use.
-
Apr 15th, 2003, 08:12 AM
#11
He doesn't want to position a control on a form, but a form on a screen.
Read his first post.
But you are correct that in this particular case both properties should return the same value.
-
Apr 15th, 2003, 08:18 AM
#12
Originally posted by Frans C
He doesn't want to position a control on a form, but a form on a screen.
Read his first post.
But you are correct that in this particular case both properties should return the same value.
Sorry, I've misunderstood the question, I though he wanted to position a control on the form. I stand corrected, in this case he should definitely use the Width property and not the ScaleWidth property.
-
Apr 15th, 2003, 02:59 PM
#13
Thread Starter
Member
Thanx everybody!
But Still cant find out how can I show an icon in the taskbar when border is set to 0.
How much large does the .Swf file make the size of the application as compared to .Gif file? I am asking so as to choose between the two formats.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|