Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




2 Small Things (change Image And Textbox Value)


I just have 2 small questions:

1. How can I make my image (lets call it PictureBox1) change when I make a selection on combobox1. I have about 16 different images to go with the 16 different options.

2. How can I make it so that when I press a button [I just need the code for the following], it changes the value of a textbox on another form, and shows the tab that form is on?

Thanks!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Can I Change Things In Other Apps I Make
Can I Make An App In VB and Have It Change A Object In A Different App In VB?

Andy

Moving Things From A Listview To A Textbox?
Hey guys I have a listview called report and it has check boxes. I have another form called form2 with a text2.text.

Is there a way when I check one item and press a button that checked item goes in the text2 of the form2?

Its just the item from the first column of the report listivew.

Thanks!

Need Help With Rich Textbox With Colors Things Look Please
ok here what i want to do like if there a word in the rtf Called Port I want the word port to be Blue and other words can someone in here please help me with this?

Small Change Needed, But Still Need Help
Hi, attached is a small program, that allows you to choose 7 playing cards, then, when button pressed, tells you the best hand from those 7, texas holdem style. What i want to do, is, instead of clicking on the value of each card, type it in, so 7 textboxes, where i can type s7, d3 etc.

Please can someone help me do this, i know it sounds simple but i cant work out how
Thanks
Alex

Things Were Okay UNTIL I Changed From Picturebox To Textbox For Output Display
Things were okay until I changed from picturebox to textbox for output display ---> Originally I was using a picturebox of which all 10 lines from a textfile displayed a-ok ... but then I changed over to textbox because I needed a scrollbar as picturebox does not have that ... now the 10 lines will not print, ONLY the very last line does ... Will someone please show me how to correct the code below to display the 10 lines of textfile instead of just the very last one?

The only change I made was I replaced Picture1.Print SampleOutput to Text3.Text = SampleOutput


Quote:




Private Sub Command2_Click()
'Runs loop to read and display all 10 lines from text file.
Open "C:My Documentsmytext.txt" For Input As #1
Do While Not EOF(1)
Input #1, SampleOutput
Text3.Text = SampleOutput
Loop
Close #1
End Sub




P.S. Why is it when I insert code indented as it should be, it comes out all left-justified when posted?

Access Query Needs Small Change
I have written a query within Access as follows:

UPDATE QueryInvoiceList SET NoOfDays = DateDiff("d",IIf(IsNull([DateReturned]),Date,[DateReturned]),[DateOnQuery])

It returns the number of days between datereturned and dateon query fields. It returns negative values i.e - 8 days. I need it to return postive values i.e. 8 days. I have written it the wrong way around and need to change it so that DateOnQuery minus DateReturned returns the number of days. If datereturned is null i want to use todays date.


I also have the following query which i need to add to the Update query above. It should calculate the average number of days.

SELECT AVG(NoOfDays)AS AvgDays FROM QueryInvoiceList;

Im not sure where to insert this, i keep getting a syntax error.

Any Access Query experts out there?

Displaying A Small Part Of A Large Image...
ok im a bit of vb newbie, only really done some basic things for the first year of my computing a-level (uk qualification type thing if u wanted to know)

now i am trying to do a really big project so i am probably going to be asking for a lot of help. so, hello the peeps of the forum

my problem: i need to have a map in my program, and it will probably be pretty huge, so i need to be able to display a small section of it, say 512x512, and have scroll bars at the sides to change the position of the view.

thanks in advance






Added green "resolved" checkmark - Hack

Listview Small Icon Image On Subitems
I have searched the forums and have not found anything I can
use to add a subitem small icon to a listview. I want to use the
second and third column for the small icons. Similare to Outlook's
mail view with attachment, importance, and follow up flag. Using
a third party control is not an option. I have to do this with the
standard VB controls.

Thanks in advance for any assistance.

Show A Small Image In A Lisview Or Grid
Dear friends,

I wish to show a small image "uparrow" or "downarrow" according to today's up/down of a stock in the "Price % Change" column.

The information is to be shown as a list view

Symbol Last Price Price % Change Date ...

IBM 99 [up image] -17 11/2/2001

Do you have solution?

DataGrid or Listview or whatelse I should use for this purpose?
Thanks very much

Inserting A Small Image Into A Form That Can Be Drawn On.
We have an electronic medical record that uses forms with a large textbox into which the user enters text describing the problem the patient has. I would like to enable the user to place a "stamp" on the form that they can them draw on. For example an outline of an eye on which they can draw. I would like to have an icon on the menubar which when clicked would show all available stamps.

Is anyone aware of a control that would allow this. If not does anyone know how I can do this.

Thank you.
ivancarr

Inserting Image In Vb Project As Per Database(as Data Changes Image Should Also Change)
i am making front end in vb6 and backend in ms access
i want as my data changes on movenext
concerned photo should also change
i am using data environments

please help

Change Textbox.Text Without Firing Change Event?
This is probably going to be one of those threads that just shoots down the list but I was wondering if there is a way to change the contents of a textbox through code that won't fire its change event. I don't think it is possible but I have seen some pretty cool stuff on the forum and thought I'd give it a shot. Thanks.

Background Image In My Textbox Or Rich Textbox
I need to place a background image in a textbox or rich textbox as well. Is there no API or GDI(?) solution?

Background Image In My Textbox Or Rich Textbox
i would like to place a fixed background image in my textbox or rich textbox so it will act like a watermark. is that possible? please help.

i tried to use an rtf file template with image on it but everytime the rich textbox is updated the image is removed from view. i would like to remain on its position.

thank you very much. :P

Change Listbox Contains Upon Change Of Textbox
Greetings,

I'm facing a problem here..
I want to change my listbox contains upon the change in my text box.

Its like when we use Jump function in Winamp.

heres my code:


VB Code:
Dim conn As New ADODB.ConnectionSet conn = GetConnection(0)Dim rs As New ADODB.RecordsetSet rs = New ADODB.Recordset 'rs.Open "SELECT PART_CODE FROM AGENT_PROD_REJECT where PART CODE = '" & txtPartCode.Text & "'", conn, adOpenKeyset, adLockOptimistic Dim xlstPartCode.ClearFor x = 0 To rs.RecordCount - 1If IsNull(rs!PART_CODE) Then    lstPartCode.Text = "No Record Yet"ElseIf Not IsNull(rs!PART_CODE) Then    lstPartCode.AddItem rs!PART_CODE     'MsgBox "Ada " & rs.RecordCount & " rekod"End Ifrs.MoveNextNext x rs.CloseSet rs = Nothing


but i have error "Syntax error in query expression"

Is anyone know??
Please..i had headache enough thinking the solutions.

Moving Things And Deselecting Things.
Okay, I have two questions. First I'll give you the noobish one. How do you deselect something like a command button so it's not highlighted? I also have a problem with my end of the year project I asked for help with a while ago. I'm trying to make it so that when you click a button, the notes on a measure (of music) move down to the next set of lines instead of going to the right off the screen. It's hard to explain, but here's the code for the command button:

VB Code:
Private Sub Command1_Click()intOMG = intOMG + 1If intOMG > 8 Then    Command1.Enabled = FalseEnd IfLine1(Line1.lbound + intOMG).Visible = TrueLine2(Line2.lbound + intOMG).Visible = TrueLine3(Line3.lbound + intOMG).Visible = TrueLine4(Line4.lbound + intOMG).Visible = TrueLine5(Line5.lbound + intOMG).Visible = True End Sub


Here's a picture of the form, which is probably the best way I can show you:

http://img.photobucket.com/albums/v6...r/untitled.jpg

Also, how can I make that scrollbar work? This should be my last question about my project (seeing as it's due tomorrow), so thanks to those who help.

Change Focus From Textbox To Textbox
Hello Evryone:

I would like to know how to change the focus between textboxs using the "ENTER" key instead of using the tab key. Right now the tab key is moving between the boxes but not the enter key?

Any Ideas?

Thanks
Art W

How Do I Change An Image?
Private Sub Image1_Click()

Image1.Picture = C:/Bitamps/Img.bmp

End Sub

Is this correct to any degree?
And how do i do a mouse-over transistion? only if the mouse is over the image will it change, then change back when the mouse moves away

Image Change Help
hello

ive just started using vb and i was wondering if anyone can answer my question.
ive put a picturebox with an image inside it , img1.jpeg
and ive put a command button beneath it.
when the button is pressed i want img1.jpeg to change to img2.jpeg, can anyone help me please!!!

Image Change
I have a img1 and when the mouse is over it i want the img one to change it's picture to a different picture, is there a way to do this?

Change An Image
I have an image that says exit, what I want is the image to change to a different image when the mouse is over it and again when it is pressed. Is there anyway to do this.

Change Repeatly An Image
Hi,

my question is, did anything know how can I change repeatlly an image?... (example I have 2,000 files with xx-ja.bmp and I want to change this files to xx-ja.jpg)

thnks for ur help

David

GDI Plus, Change Quality To JPG Image.
Hi,
I'm trying to change the quality Image of a picture in order to decrease its total KBytes.
I'm using the GDI Plus in my visual basic application, I read a TIFF image and then I convert it into JPG Format but when I try to change the default values of this conversion (in order to decrease in KBytes) it doesn't take any change.
My parameters:

Dim params As EncoderParameters
·
·
·

Dim MyFunction (dim CompQuality)

lQual = CompQuality
params.Count = 1
params.Parameter.GUID = StringToGuid(EncoderQuality)
params.Parameter.NumberOfValues = 1
params.Parameter.Type = EncoderParameterValueTypeLong
params.Parameter.Value = VarPtr(lQual)
lError = GdipSaveImageToFile(hSRC, strTargetJPG, tGuids(lIndex), params)

----
Thank You.

How To Change An Image At Runtime?
I used a line similar to

img_showname.Picture = "C:cw2004picsslam.jpg"

but it did not work, I got a Type Mismatch error.

How do you change a picture at runtime?

Useform Image Change
Another one that I cannot fathom out.

Is it possible to change the image shown within a userform based on the selection of a combobox within the same userform.

i.e. when userform1 loads, the user makes a selection from a combobox on the form and the image below changes based on their selection???

Many thanks

How To Change Image Resolution?
Hi There,

How can we change image resolution, (dpi) in the picture box control.

thanks in advance

bye,
SIDHU

Change Desktop Image
hello,

I would like to change the desktop image, I know about SystemParametersInfo

althought my problem is I need to be able to change the wallpaper from an image box or a picture box, not having the actual picture on my HD

any ideas?

User Can Change My Image!
Got a image in my vb 6 program.

But it seems like the users can access and change the .jpg file.

Is there a way for me to bind the image to the program, make it inaccessable?

Change Picturebox Image?
I'm trying to change the image in a picture box I have (well, 2 actually, its supposed to look like rolling dice), but I can't figure out how to do it.


VB Code:
pictD1.Picture = diceImages(d1)pictD2.Picture = diceImages(d2)


pictD1 and pictD2 are picture boxes, diceImages is a string array, with each value from 1 to 6 containing the path for GIF image of a die. D1 and D2 are the random numbers representing the values of the dice.

I keep getting a type mismatch, so I know there's probably something very wrong and very obviously wrong with my code but...I can't figure it out.

How Can I Change The Image Size
I drawed lots of regions and line inside of a picturebox using API. (around 150 regions filled by different kind of brush)

I wonder how can I change their size when i resize the picturebox. I try cls and draw again, the effect is not smooth as all the data are read from database.

Any good method?

Thanks

Change Button Image
I am after a code that will show me all Change Button Image's

How To Change The Image From All Froms
Hello all.

I have an image control named "Image1" on all forms.
I want to change the picture of that image control in all forms through code.

Please help me
Thanks in advance

Farooq

Image Change Problem
I have this little code that plays an mp3 with a WMP control and i have a timer checking every second to Check what time to change the image. Everything as far as changing the image is great. It changes when i want it to at each time. The issue i am having is that everytime the timer checks to see what time it is. It slightly pauses WMP. Its not a huge pause but its there and its kind of annoying. How do i correct this issue?


VB Code:
Dim NightHour As Integer' VARIABLESDim NightMinute As IntegerDim DayHour As IntegerDim DayMinute As IntegerDim ParseNight() As StringDim ParseDay() As StringDim NightTime As StringDim DayTime As String  Private Sub Form_Load()        Player.Url = "total - If You Want Me (feat Mase).mp3"        Player.Controls.PlayEnd Sub Private Sub Timer1_Timer() ' SETTING VARIABLESNightTime = "19:00:00"DayTime = "6:00:00" ParseNight() = Split(NightTime, ":")NightHour = ParseNight(0)NightMinute = ParseNight(1) ParseDay() = Split(DayTime, ":")DayHour = ParseDay(0)DayMinute = ParseDay(1) ' CHANGE IMAGE AT SPECIFIED TIMESIf Time > TimeSerial(DayHour, DayMinute, 0) And Time < TimeSerial(NightHour, NightMinute, 0) Then    Me.Picture = LoadPicture("Image1.jpg")Else    Me.Picture = LoadPicture("Image2.jpg")End IfEnd Sub

Change Image Properties
You can only open JPEGs in VB. You can't modify them unless you use a third-party control.

How To Change An Image In A Picturebox ?
How to change an image in a picturebox (or in an imagebox) with a command ?

Thanx

Mouse Over,image Change
Hello this is a code i have

Private Sub heal_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

If heal.Picture.Handle = 0 Then
heal = LoadPicture(clean.Picture)
Else
heal = LoadPicture(play.Picture)
End If
End Sub


It 'would' work but it says clean.picture and play.picture are not file names

when i try


Private Sub heal_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)


If heal.Picture.Handle = 0 Then
heal = clean.Picture
Else
heal = play.Picture
End If
End Sub


It gives me a different error about procedure also if i try heal.picture = play.picture


I know i have all the images there, and they are images, but i can't make it change the picture

Mouseover Change Image
I'm trying to create a form with mouseover effects on certain images...
I thought it was just a mousemove event, with IMAGENAME.picture = "PIC LOCATION" but apparently I'm wrong, I get a "type mismatch" error when I run it and try to move my mouse over it.
Any ideas?

How To Change Colors In An Image.
hi friends,

            In my VB project I Used a skin(created in vb) with plain image having single color . How to change that image colors. I am able to change colors of VB form, shape,lable . But unable to change a pictures colors. I want this.

           Can any one help me.

urs
suma.N

Change Msflexgrid To Image!!!
Hello All Memebrs

How can i take the contents of the msflexgrid and save it as image.I hope you can understand my question.
thanks alot for advice





Egyptian Man

Change Brightness Of Image
Hello
Can anybody Suggest How To Change the Brightness Of Image.
I am Using PictureBox to display Imge. I want to Change the Brightness of Iamge According to the Slider Change

How To Change An Image Size?
Hi again...
I would like to know if there is a way to load a picture on a pictureBox and to make this picture the appropiate size as to fit on the pictureBox control dimensions...

Hope someone can help...

Textbox Change
I have a textbox with text and I am sending data to it every second.
But I want the letters that stay the same be the color black and those letters that have changed be the color red.

the color isn't necissary just something that will make the changes draw your attention to you more than the letters that haven't changed.
Any ideas?

TextBox Value Change-Run Sub
How can I run a function or a sub when the value of a textbox is changed by the user, no enter key?

Textbox Change
how do you make the selection of a textbox change from one to the next after you enter a value in it? for example, when you install some programs and it asks for the CD-Key, notice how after you enter the character in the first textbox it automatically goes to the second textbox without you having to tab or select it.

Change In Textbox
Is there a command to know if the text in a textbox changes?

Change A Textbox
I am writing a software that requires a password to open it and therefore begin using it. All i want to know is how do you get a textbox to stay the same way you left it the next time you run the program. e.g. change textbox1 from "Hello" to "Bye" close the program and then when it is reopened it will say "Bye" and not "Hello". Please help me as this is the only prob i need to solve before my program is complete. I may also want to make the program a multiple user software.

Thanks in advance

Change Textbox Into A IP BOX! How??????
How can i change a normaly Textbox on a form to a IP Box
Like:

. . .

(Where u can only between the Point insert valied numbers ( 0 to <256)


Help Please!

Change Name Of TextBox Or Ref. To It.
Hello,

I'm new to VB programming and would like to know if/how I can change the Name of a TextBox.
Example: I want to change TextBox195 to TextBox196. If that is not possible, can I use a variable such as.
Example: TextBox195 = TextBox195+1 < which would be TextBox196

I hope my question is not too stupid.

Thanks

Art

Change To A Textbox
On loading a form, I assign values (from disk) to a textbox on my form. I want to set a flag for later processing ONLY if text is entered into Text.1 from the form. And since that text may be cut and pasted, using _KeyPress isn't really an option since the user may not hit a key after the C & P.

Code:
(no declarations shown for clarity here and this is pseudo code)

Private Sub Form_Load()

Ram_Text = DataFromFile.MyRecord 'valid record from file in RAM

Temp_Text = Ram_Text

Text1.Text = Ram_Text

End Sub

Private Sub Text1_Change()
      Temp_Text = Text1.Text

      If Temp_Text <> Ram_Text Then TextHasChanged = True

End Sub



Problem is, it seems that the act of loading in the Ram_Text in Form_Load is enough to set the HasChanged flag.

Copyright © 2005-08 www.BigResource.com, All rights reserved