-
October 12th, 2012, 02:23 PM
#1
PictureBox settings.
I need this: see in the picture.
Please help me....
-
October 12th, 2012, 02:54 PM
#2
Re: PictureBox settings.
Ok, since you don't show any code all I can say is 'why don't you draw that...'
-
October 12th, 2012, 03:02 PM
#3
Re: PictureBox settings.
Originally Posted by S_M_A
Ok, since you don't show any code all I can say is 'why don't you draw that...'
You see in vb 2010 i upload png picture and change design time control manualy. It no has any code. Its easy and fast. But in Vb6 if i upload png picture white area still show because that area is pictureBox. I Vb6design time is no manualy change pictureBox settings just like in Vb2010. So in order to manage do what i want to do in vb6 i need write code witch can make pictureBox white area transparent o disapear. I dont know how that code must be writen.
-
October 14th, 2012, 08:07 AM
#4
Re: PictureBox settings.
In this picture you see program with pictureBox witch is one of zodiac sings. Now i need add 12 zodiac sings and make that every sing show from curent answer.
My programs code is this:
Code:
If strAux >= "0321" And strAux <= "0420" Then
SDate.Caption = "Avinas"
psavt.Caption = "Įkvėpimas ir Drąsa"
psavn.Caption = "Impulsyvumas ir Nedisciplinuotumas"
kri.Caption = "Kantrybės"
trm.Caption = "Greit užsidega, greit perdega"
Tal.Caption = "Impulsas, Veiksmas, Energija"
Apie.Caption = " Apie tuos, kuriuos valdo impulsas"
tp.Caption = "Liūtas, Avinas, Jautis, Šaulys, Vandenis, Žuvys"
sns.Caption = "Vėžiu, Svarstyklėmis ir Ožiaragiu"
jr.Caption = "Nepriklausomybė"
dev.Caption = "Aš esu"
tll.Caption = "Plaktukas"
end if
I try add 12 picturebox with different names and make picBox visible = false.
Then i write this code:
Code:
If strAux >= "0321" And strAux <= "0420" Then
SDate.Caption = "Aries"
picBox1.visible = true (aries picture)
end if
And it work. When answer was "Avinas" then picBox show aries sing. And that i do with 12 zodiac sings. But now i came with problems:
1. Third zodiac sing not apears.
2. When first zodiac sings apear lets say "Aries" second time apear "Taurus" but when need show zodiac from "Taurus" sign to "Aries" it not work. Then i try write this code:
Code:
If strAux >= "0321" And strAux <= "0420" Then
SDate.Caption = "Aries"
picBox1.visible = true (aries)
picBox2.visible = false (taurus)
end if
If strAux >= "0421" And strAux <= "0521" Then
SDate.Caption = "Taurus"
picBox1.visible = false (aries)
picBox2.visible = true (taurus)
It work with only two picture. When i try in the same way add another zodiac in not apears. So can you know problem? I think it is code writen not corecly.
Last edited by Halosar7; October 14th, 2012 at 08:10 AM.
-
October 14th, 2012, 09:15 AM
#5
Re: PictureBox settings.
picBox1.visible = true (aries)
what I have highlighted in red should either not be there or should have a comment character in front of it. As is it is not valid code
Always use [code][/code] tags when posting code.
-
October 14th, 2012, 09:46 AM
#6
Re: PictureBox settings.
Originally Posted by DataMiser
picBox1.visible = true (aries)
what I have highlighted in red should either not be there or should have a comment character in front of it. As is it is not valid code
I know that. In this code i put sample with name like (aries) so you can better understand witch code is wat. In program code is this.
Code:
If strAux >= "0321" And strAux <= "0420" Then
SDate.Caption = "Aries"
picBox1.visible = true
picBox2.visible = false
end if
If strAux >= "0421" And strAux <= "0521" Then
SDate.Caption = "Taurus"
picBox1.visible = false
picBox2.visible = true
You see picturebox1 is "aries", picturebox2 is "taurus" so in code end i writen wat is wat because when you see in picturebox1 you dont understand what purpose that code must be.
-
October 14th, 2012, 12:18 PM
#7
Re: PictureBox settings.
Wrong way to compare STRING FIELDS. Use a Function() and convert IF POSSIBLE.
-
October 14th, 2012, 12:34 PM
#8
Re: PictureBox settings.
Originally Posted by Halosar7
I know that. In this code i put sample with name like (aries) so you can better understand witch code is wat. In program code is this.
If you want to add comments to your code you should use the comment character so we know it is a comment otherwise we can not know that and as written the code would not have worked which is why I pointed it out.
where is strAux being assigned a value? Why are you using strings to compare a numeric value?
Always use [code][/code] tags when posting code.
-
October 14th, 2012, 12:41 PM
#9
Re: PictureBox settings.
Originally Posted by DataMiser
where is strAux being assigned a value? Why are you using strings to compare a numeric value?
"Why are you using strings to compare a numeric value" - i using this because it is astrology program witch show info by date of birth. In picture you see 8 square, then must be writen numbers.
"where is strAux being assigned a value" - strAux being assigned to this value:
Code:
If IsNumeric(Text1.Text) And _
IsNumeric(Text2.Text) And _
IsNumeric(Text3.Text) And _
IsNumeric(Text4.Text) And _
IsNumeric(Text5.Text) And _
IsNumeric(Text6.Text) And _
IsNumeric(Text7.Text) And _
IsNumeric(Text8.Text) Then
If Val(Text1.Text) <> 1 And Val(Text1.Text) <> 2 Then
MsgBox "Metai turi prasidėti skaičiuomi 1 ar 2", vbInformation, "Dėmesio!"
Exit Sub
End If
If Val(Text5.Text & Text6.Text) < 1 Or _
Val(Text5.Text & Text6.Text) > 12 Then
MsgBox "Mėnesiai turi būti tarp 01 ir 12", vbInformation, "Dėmesio!"
Exit Sub
End If
If Val(Text7.Text & Text8.Text) < 1 Or _
Val(Text7.Text & Text8.Text) > 31 Then
MsgBox "Dienos turi būti tarp 01 ir 31", vbInformation, "Dėmesio!"
Exit Sub
End If
intTotal1 = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text)
strTotal1 = Format(intTotal1, "00")
intTotal2 = Val(Left(strTotal1, 1)) + Val(Right(strTotal1, 1))
If intTotal2 > 9 Then
strTotal2 = Format(intTotal2, "00")
intTotal2 = Val(Left(strTotal2, 1)) + Val(Right(strTotal2, 1))
End If
Label1.Caption = Format(intTotal2)
Dim strAux As String
strAux = Text5.Text & Text6.Text & Text7.Text & Text8.Text
If strAux >= "0321" And strAux <= "0420" Then
Last edited by Halosar7; October 14th, 2012 at 12:45 PM.
-
October 14th, 2012, 04:07 PM
#10
Re: PictureBox settings.
I still have no clue why you would use strings when the values are numeric but that is beside the point what you are really looking for is a way to do a transparent image with a picture box. This is something I have not tryied to do. I know by default it is not supported but there are ways it can be done. Rather than me searching and giving you a link I suggest you do a search for somethign like VB6 transparent Picturebox and see what you turn up.
Always use [code][/code] tags when posting code.
-
October 14th, 2012, 04:34 PM
#11
Re: PictureBox settings.
Originally Posted by DataMiser
I still have no clue why you would use strings when the values are numeric but that is beside the point what you are really looking for is a way to do a transparent image with a picture box. This is something I have not tryied to do. I know by default it is not supported but there are ways it can be done. Rather than me searching and giving you a link I suggest you do a search for somethign like VB6 transparent Picturebox and see what you turn up.
I did it my self with 12 picture. Only thing left is find out how remove picturebox white backround around picture. You can see first picture in this topic. If you are interesting what code i write solve my 12 picture, that is it this:
Code:
Pic1.Visible = True
Pic2.Visible = False
Pic3.Visible = False
Pic4.Visible = False
Pic5.Visible = False
Pic6.Visible = False
Pic7.Visible = False
Pic8.Visible = False
Pic9.Visible = False
Pic10.Visible = False
Pic11.Visible = False
Pic12.Visible = False
End if
Pic2.Visible = True
Pic3.Visible = False
Pic4.Visible = False
Pic5.Visible = False
Pic6.Visible = False
Pic7.Visible = False
Pic8.Visible = False
Pic9.Visible = False
Pic10.Visible = False
Pic11.Visible = False
Pic12.Visible = False
Pic1.Visible = False
End If
Pic3.Visible = True
Pic4.Visible = False
Pic5.Visible = False
Pic6.Visible = False
Pic7.Visible = False
Pic8.Visible = False
Pic9.Visible = False
Pic10.Visible = False
Pic11.Visible = False
Pic12.Visible = False
Pic1.Visible = False
Pic2.Visible = False
I do this with all 12 picture. Of course first i need disable all picture visible = false in desing property.
-
October 14th, 2012, 05:40 PM
#12
Re: PictureBox settings.
Because you probably NESTED all the loops into one. First fails, and it skips the rest...
Might want to POST the code as a sample, and upload that for someone (brave) to test it.
-
October 14th, 2012, 05:44 PM
#13
Re: PictureBox settings.
Like I said you are trying to do a transparent picture box which is not supported by default. Making pictures visible or invisible has nothing to do with it. Did you try the search I suggested? You indicated that you could do it in VB.Net, why are you not using VB.Net?
Always use [code][/code] tags when posting code.
-
October 14th, 2012, 06:14 PM
#14
Re: PictureBox settings.
Originally Posted by DataMiser
I said you are trying to do a transparent picture box
You misunderstand, my all program is transparent. PictureBox is not set that way and as a result we see white area around picture. Better way to deal with this is upload a png picture then set transparent picturebox backround. It works i tray do that. Problems is whether you set picturebox transparent or not, it will be that box backround. If you try set picturebox opacisy to zero then disapears that box.
I solve my problems, now program is build to exe file. I run it and tested, it works without any errors. I dont use VB.Net because i have vb6 and vb2010 express.
Who better, vb6 or vb.net? Vb2010 express too difficult to me.
-
October 14th, 2012, 06:34 PM
#15
Re: PictureBox settings.
VB2010 is VB.Net, in fact all versions of VB after 1998 are VB.Net
VB6 is VB1998
I'm not surprised that I missunderstood, very hard to determine what you are saying in most of the posts here. It sure sound slike you are trying to get a transparent background on a picture box though.
Always use [code][/code] tags when posting code.
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
|