|
thanks sir, i knew this point, but that answer is not what i want. i just want to know after compare..what is result? the result is greater value or less value? i searched online and asked someone already. so still couldn't find solution.
|
|
|
|
|
the result of a comparison is a boolean value, i.e. either true or false, and not a number nor anything else.
Now do yourself a favor: go buy a book and study.
|
|
|
|
|
hahahahaha, i think you also need to buy this book to study hard, although my ability in vb6 is really limited, but i don't agree compare can only get boolen.
|
|
|
|
|
Actually, YOU do need to buy a book and study something called "binary math". Camparing something is usually a boolean result. But, in your simple example "compare = int(200 and 4)" this results in a binary AND operation on two values, resulting in a third value that is assigned to a variable called "compare".
|
|
|
|
|
I am creating a main menu form in Access 2007. I want to use 3 graphics as logos on this form.
I want one to be aligned to upper-left (it is horizontally extended with stripes to stretch across). I also want 2 other graphics to be aligned in the upper-RIGHT of my form (two graphics that occupy equally square areas).
I am making this main menu form to FILL the area of Access, so when I resize the Access window's containing frame, the logos will adjust accordingly.
Is this possible? How can i do this (Use the Header area? Use the form's Picture property? Unbound object? Depth, Z-order?)
Thank you.
JJM
|
|
|
|
|
You'd probably want to find a forum dedicated to Access to ask this question. Everything you're asking is very specific to the behavior of Access and not how to interact with it using VB/VB.NET.
|
|
|
|
|
I am having an issue where suddenly I am getting a file not found exception when populating a picturebox.
Private Sub loadimage(ByVal strImage As String)
If isOnline Then
Me.ToolTip1.SetToolTip(Me.pbMain, strImage)
End If
Try
Me.pbMain.Image = Image.FromFile(strImage)
Me.pbMain.SizeMode = PictureBoxSizeMode.StretchImage
Catch fn As System.IO.FileNotFoundException
pbMain.Image = Nothing
End Try
End Sub
The pain of the thing is that if I can navigate to the file through Explorer using the value of strImage, it just won't load on screen. This has always worked previously, I am not entirely sure why it won't work now.
To top it off, it works fine on my development machine, so it is tough to track down why it is happening. Thoughts?
|
|
|
|
|
eddieangel wrote: Thoughts?
Lots of them. I could ask one hundred questions, but I won't.
It is up to you to provide more information about your app, the problem frequency, the value of strImage, the history of that file, etc.
BTW: don't swallow exceptions, have Exception.ToString() logged and study it!
|
|
|
|
|
I thought there might be a quick answer that I was not aware of. This process in this application has worked indefinitely. The value of the strImage is UNC path (\\fileserver-01\images\201001010001_00000001.jpg)
If I type the UNC path into the run window it pops up. As you can see I specifically catch the file not found exception. I had a message box pop up that printed the value of strImage, and I ran that value through the run window and got the file to pop up, but it will not come up in the picture box.
I do have a logging function, I just took it out of this particular example to try and simplify and isolate the error.
I can't duplicate the issue on my development machine
|
|
|
|
|
so it could be an access privilege problem, your app not being allowed to handle UNC filepaths. Not sure what the right solution is; maybe you could map a drive letter and use that instead?
|
|
|
|
|
I mapped the network drive and am still unable to access anything with the application. My first guess was permissions as well and I am sure that there is something to it, but I can't figure out what. I can access network resources via UNC path or mapped drive using the run dialog, but the same path, UNC or map, does not work within the application. File.Exists(strImage) produces a false result.
It is truly bizzare because it still works on my machine, and another machine that I just loaded yesterday, but it does not work on several other machines. Environmentally speaking, they are all over the board with operating system and patch level, and there is no commonality between the machines that do work. One is Windows Vista Home and one is Windows 7 Professional. However, six other machines with Windows Vista Home do not work.
Beyond that, if it were a straight permissions issues I would expect an IO exception as opposed to a FileNotFound. It is all very vexing seeing as how this application has worked and been stable using these same parameters for more than a year only to start freaking out now.
I want to blame Microsoft, but I doubt that I can.
|
|
|
|
|
Just an idea, without any guarantee:
there is a tool called " .NET Framework XXX Configuration Tool " (file: Mscorcfg.msc) where XXX is the .NET version;
the tool came installed with 1.0 and 1.1; for later versions it would be part of the SDK (which you need to install separately).
Not sure there is one configuration common for all Framework versions (i.e. only the tools evolve), or configs are individual (tools and data are separate).
Functionality includes:
- security (adjust zone security, increase assembly trust)
- configure individual applications (?)
More here[^]
|
|
|
|
|
I configured the application using the tool as outlined. I increased the assembly trust for the application to full trust but it yielded no results.
The crux of the issue appears to be that the application just doesn't even see that the file exists. It worked fine up until two days ago with no changes, I am wondering if it got zapped with an update. Either way it is crippling my application and making me crazy.
Thanks for all of your insight, hopefully I will be able to isolate the issue on other computers.
|
|
|
|
|
You're welcome. I'll throw in one more suggestion:
you might try and correlate the failing machines with the four categories you get answering these two questions:
- is it Windows Vista/7 or something older?
- has the user administrative rights?
|
|
|
|
|
Just another thought... Are these machines setup in a domain (Active Directory) environment or is everything Workgroup?
If everything is workgroup, that would cause a problem like this. Other than that, NTFS and Share permissions are the most common cause of this problem.
|
|
|
|
|
It is a domain environment. The Windows Vista Home clients are not connected to the domain, but they are authenticated with the fileserver. I am able to access files on the file server from those machines using explorer, just not with my application at the present time.
|
|
|
|
|
Hi, dear all
I need to create a text file with each control at a line, in this line, it include control value, control name and description, the output should be as the following:
False Print - XXXXXXXXXXXXXXXXXXXXXXXXXX
2 Contrl 1 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3.6 Control 2 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
23.8 Control 3 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.005 Control 4 - XXXXXXXXXXXXXXXXXXXXXX
The problem is align the column 1, how can I align the decimal point at same position at each line, and prefix the heading as space? and the heading space number is changed according the value?
For example, for contrl 1 and control 2, the heading space is 3, but for control 3, it's 2.
I use something like:
value = Format(Contrl1, " 0")
Writer.WriteLine(value.PadRight(ValueFieldLen) & _
"Contrl 1".PadRight(ContrlFieldLen) & _
"- XXXXXXXXXXXXXXXXXXXXXXXXXX")
value = Format(Contrl3, " 0.0")
Writer.WriteLine(value.PadRight(ValueFieldLen) & _
"Control 3".PadRight(ContrlFieldLen) & _
"- XXXXXXXXXXXXXXXXXXXXXXXXXX")
In this way, the prefix spacing is fixed, this isnot I want.
Thanks!
|
|
|
|
|
Andraw Tang wrote: how can I align the decimal point at same position at each line, and prefix the heading as space? and the heading space number is changed according the value?
You're going to have to show examples of this. Your examples would have to be posted inside PRE tags, otherwise HTML formatting will remove all spaces and wreck the formatting.
If you have a variable number of numbers before and after the decimal point, you'd have to either:
1) Pad both sides of the decimal point with spaces, making the column a fixed width that can contain the maximum number of digits for BOTH sides of the decimal point,
2) Keep track of the number of numbers on both sides of the decimal point and recalculate the fixed width of the column, the position of the decimal point inside the column, and what the maximum padding values show be for both sides of the decimal to keep the decimal point in the same place. This would require that you know all of the values in the column before you write event a single line to the text file.
|
|
|
|
|
|
Eddy,
Thank you very much, that what I did right now.
|
|
|
|
|
I have a text box and a timer and a button "stop"
Is it possible that when "Fire" string is in textbox then t1_timer() event fire.
Actually I have to send repeatedly a message when "Fire" is in Text box.and when stop button is clicked it stops fire event.
How it can be????
|
|
|
|
|
Handle the Change event of the TextBox and check for the string you want. IF the string you want is there, enable the Timer at whatever interval you want. In the Click even tof the Button, disable the timer.
This is very easy to do, and shows that you have no experience in VB at all. If this is the case, I seriously suggest dropping VB6 and picking up VB.NET before you waste a bunch of time on a lanugage that's been dead for quite some time now.
|
|
|
|
|
Dave Kreskowiak wrote: that's been dead for quite some time now.
It's not completely dead, from time to time it pops it's ugly head up and gives me head ache's. (Damn I hate maintaining legacy projects )
|
|
|
|
|
Phoenix the bird for programming.
|
|
|
|
|
So do I. But, from MS' point of view, it's dead, buried and decaying.
|
|
|
|