Results 1 to 6 of 6

Thread: Very noobish question regarding VB

  1. #1
    Senior Member Hicks12's Avatar
    Join Date
    Jan 2008
    Location
    Plymouth-SouthWest
    Posts
    6,586
    Thanks
    1,070
    Thanked
    340 times in 293 posts
    • Hicks12's system
      • Motherboard:
      • Asus P8Z68-V
      • CPU:
      • Intel i5 2500k@4ghz, cooled by EK Supreme HF
      • Memory:
      • 8GB Kingston hyperX ddr3 PC3-12800 1600mhz
      • Storage:
      • 64GB M4/128GB M4 / WD 640GB AAKS / 1TB Samsung F3
      • Graphics card(s):
      • Palit GTX460 @ 900Mhz Core
      • PSU:
      • 675W ThermalTake ThoughPower XT
      • Case:
      • Lian Li PC-A70 with modded top for 360mm rad
      • Operating System:
      • Windows 7 Professional 64bit
      • Monitor(s):
      • Dell U2311H IPS
      • Internet:
      • 10mb/s cable from virgin media

    Very noobish question regarding VB

    Right well ive almost finished my website for solving quadratic equations and plotting it on a graph, however i am stuck on a small part to do with validation.

    I want an image to display if the user has entered an incorrect value into the text box (i.e not a number), this is a Tick or a cross depending on whats right, ive got the if statements and stuff working but i cant remember how to actually set the image to be invisible.

    Anyone know the line of code needed for this? Using VB/HTML, any helps appreciated!
    Quote Originally Posted by snootyjim View Post
    Trust me, go into any local club and shout "I've got dual Nehalem Xeons" and all of the girls will practically collapse on the spot at the thought of your e-penis

  2. #2
    Pre-Cambrian nibbler's Avatar
    Join Date
    Aug 2009
    Location
    London
    Posts
    3,668
    Thanks
    913
    Thanked
    266 times in 216 posts
    • nibbler's system
      • CPU:
      • i5-2410m
      • Memory:
      • 6GB ddr3 1333mhz
      • Storage:
      • 256GB Plextor M5S SSD
      • Graphics card(s):
      • 1GB 6650M
      • Operating System:
      • Windows 7 64 bit

    Re: Very noobish question regarding VB

    When I used VB at school, there was obviously the box at the side under the properties of the selected field where you could tick a box. From memory, it's just [nameofimage].visible=false?
    I would be amazed if that was right mind you.
    Join the HEXUS Folding@home Team!!


  3. Received thanks from:

    Hicks12 (23-11-2010)

  4. #3
    Senior Member Hicks12's Avatar
    Join Date
    Jan 2008
    Location
    Plymouth-SouthWest
    Posts
    6,586
    Thanks
    1,070
    Thanked
    340 times in 293 posts
    • Hicks12's system
      • Motherboard:
      • Asus P8Z68-V
      • CPU:
      • Intel i5 2500k@4ghz, cooled by EK Supreme HF
      • Memory:
      • 8GB Kingston hyperX ddr3 PC3-12800 1600mhz
      • Storage:
      • 64GB M4/128GB M4 / WD 640GB AAKS / 1TB Samsung F3
      • Graphics card(s):
      • Palit GTX460 @ 900Mhz Core
      • PSU:
      • 675W ThermalTake ThoughPower XT
      • Case:
      • Lian Li PC-A70 with modded top for 360mm rad
      • Operating System:
      • Windows 7 Professional 64bit
      • Monitor(s):
      • Dell U2311H IPS
      • Internet:
      • 10mb/s cable from virgin media

    Re: Very noobish question regarding VB

    I fought it would have been that but it really doesnt seem to work, google seems to show no real help either as that statement seems to be the answer and yet doesnt work >.<.

    Baffled tbh .
    Quote Originally Posted by snootyjim View Post
    Trust me, go into any local club and shout "I've got dual Nehalem Xeons" and all of the girls will practically collapse on the spot at the thought of your e-penis

  5. #4
    Senior Moment blueball's Avatar
    Join Date
    Aug 2005
    Location
    Edinburgh
    Posts
    2,426
    Thanks
    846
    Thanked
    379 times in 294 posts
    • blueball's system
      • Motherboard:
      • Asus Z390A
      • CPU:
      • i9-9900KS
      • Memory:
      • Kingston 64GB (2x32GB) DDR4 2400MHz
      • Storage:
      • 2TB Samsung 970 EVO Plus NVMe PCIE M.2 plus Samsung 860 EVO 4TB SSD
      • Graphics card(s):
      • ASUS TUF RTX 3080 Ti GAMING OC
      • PSU:
      • Corsair HX850 850 W Full Modular 80 Plus Platinum
      • Case:
      • Corsair Carbide 330R Ultra Silent Midi Tower
      • Operating System:
      • Win 10 Pro x64
      • Monitor(s):
      • IIYAMA 3461WQ IPS 34" 3440x1440 plus BenQ GW2765HT IPS 27" 2560x1440
      • Internet:
      • Plusnet 28Mb

    Re: Very noobish question regarding VB

    You could get it to show a 1 pixel transparent gif until you needed the cross or tick?
    Rgds,

    BB
    Hexus Trust here and here

  6. Received thanks from:

    Hicks12 (23-11-2010)

  7. #5
    Senior Member
    Join Date
    May 2009
    Location
    Norfolk
    Posts
    474
    Thanks
    3
    Thanked
    26 times in 26 posts
    • pipTheGeek's system
      • Motherboard:
      • Asus P6T Deluxe
      • CPU:
      • Core i7 920 @ 3.6GHz
      • Memory:
      • 3 * 2Gb Corsair XMS @ DDR3 1800
      • Storage:
      • 300GB 15K SAS + 500Gb
      • Graphics card(s):
      • GTX570
      • PSU:
      • corsair 760i
      • Case:
      • Corsair 550d
      • Operating System:
      • Windows 7
      • Monitor(s):
      • Dell Alienware 23"
      • Internet:
      • VM 50Mb

    Re: Very noobish question regarding VB

    I assume the image is displayed in a normal image tag? I am also going to assume that this is ASP.NET not classic ASP. If it is classic ASP then ignore the rest of this post and let me know, I'll have to go dig up my ASP knowledge, might take a while...
    Assuming that both of those are right then you have a few choices to consider.

    Skip the explicit validation and use one of the validators. There are built in ones that you can just dump on the form, link to the controls and off you go. There are also custom validators that you can write code to handle the validation.

    Add a runat="server" (if it isn't present already) to your img tag, also make sure it has a name and an ID set (preferably the same). This will allow you to reference it server side. To hide/show it you need to modify it's style. In the style attribute you need to include either
    Visibility:Hidden to hide it and Visibility:Visible to display
    or
    Display:none to hide and either Display:Inline or Display:Block or Display:Inherit
    Making it display:none will stop it using space, visibility:hidden will hide it but leave it taking up space.
    (Have i spelt visibilty correctly?)

    your last choice is to use the built in asp.net image control instead of an image tag. (In the HTML of your page this will show as <asp:Image>.) This does have a visible property which you can access in the code behind as shown by nibbler.

  8. Received thanks from:

    Hicks12 (23-11-2010)

  9. #6
    Senior Member Hicks12's Avatar
    Join Date
    Jan 2008
    Location
    Plymouth-SouthWest
    Posts
    6,586
    Thanks
    1,070
    Thanked
    340 times in 293 posts
    • Hicks12's system
      • Motherboard:
      • Asus P8Z68-V
      • CPU:
      • Intel i5 2500k@4ghz, cooled by EK Supreme HF
      • Memory:
      • 8GB Kingston hyperX ddr3 PC3-12800 1600mhz
      • Storage:
      • 64GB M4/128GB M4 / WD 640GB AAKS / 1TB Samsung F3
      • Graphics card(s):
      • Palit GTX460 @ 900Mhz Core
      • PSU:
      • 675W ThermalTake ThoughPower XT
      • Case:
      • Lian Li PC-A70 with modded top for 360mm rad
      • Operating System:
      • Windows 7 Professional 64bit
      • Monitor(s):
      • Dell U2311H IPS
      • Internet:
      • 10mb/s cable from virgin media

    Re: Very noobish question regarding VB

    Yeah it is an ASP.net, thanks for the effort in helping me. My group decided that the function was no longer needed, i had already got a general validation code for the whole thing which was also causing a bit of a mess for when i tried to add the next bit. We have just left it with that and are concentrating on getting it to plot values correctly... we only got taught how to do it yesterday and the deadline is for this day at 1pm(maths is the cw and computing taught us this). Our tutor wasnt happy that maths was ahead lol! SO might get an extension.


    Anyway, appreciate the effort you made to giving a good suggestion to my question .
    Quote Originally Posted by snootyjim View Post
    Trust me, go into any local club and shout "I've got dual Nehalem Xeons" and all of the girls will practically collapse on the spot at the thought of your e-penis

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to ask an anonymous question?
    By Allen in forum General Discussion
    Replies: 26
    Last Post: 03-12-2009, 02:36 PM
  2. Creationist question on GCSE Biology exam
    By JPreston in forum General Discussion
    Replies: 17
    Last Post: 06-07-2009, 08:35 PM
  3. Quick VB .Net Question
    By crazyfool in forum Software
    Replies: 3
    Last Post: 20-04-2009, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •