|
I have a button with a call to the minimizeall method.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MinimizeAll()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Me.WindowState = FormWindowState.Maximized
End Sub
Works fine. that way. I tried your method and through the button click, but there is a timing issue with the minimizing and the maximizing. Break them out into sep routines and it works fine.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Yes, enabling a timer to restore my window after the call to the minimize works fine
I guess the keys are not imediatelly processed and calling thread.currentthread.sleep(1000) stops the whole app and makes no difference
There must be some way to force the keys to be processed
Thanks for the tip
Alexei Rodriguez
|
|
|
|
|
|
Is there a better way than this to parse through a string to break up the vatious elements?
Example of what I'm doing now...
Dim strTemp As String
Dim tst,tst1,tst3,tst4,tst5,tst6,tst7 As String
Dim Name1,Name2,Name3,,Name4,Name5,Name6,Name7 As String
strTemp = "Name1:Name2/Name3.Name4.Name5.Name6.Name7"
tst = strTemp.IndexOf(":")
Name1 = strTemp.Substring(0, tst)
tst1 = strTemp.IndexOf("/")
Name2 = strTemp.Substring(tst, tst1 - tst)
Name2 = Name2.TrimStart(":")
tst2 = strTemp.IndexOf(".")
Name3 = strTemp.Substring(tst1, tst2 - tst1)
Name3 = Name3.TrimStart("/")
tst3 = strTemp.IndexOf(".")
Name4 = strTemp.Substring(tst2, tst3 - tst2)
Name4 = Name4.TrimStart(".")
There must be a better way, what am I missing??
TIA
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Use the Split[^] function to automatically split the string up into an array.
|
|
|
|
|
Thanks....This more what I had in mind. I think I learned about the Split Function 3 or 4 years ago and forgot it.
Using this is like a little toolbox in itself!
Thanks again..If you have any other tips on how to use this I would be much ablidged...
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Since you have multiple characters to split on, you could also use regular expressions. In this case the pattern would probably be [without the space between : and (]
([^:]+): ([^/]+)/([^.]+)\.([^.]+)\.
That pattern may not be correct; I just typed it in to the reply without testing it. If you have not used regular expressions before, they are much to big a topic to cover here but are well worth learning.
As a side note, your example will give test3 = test2 since both will find the first period. Also, if you used Name2 = strTemp.Substring(tst + 1, tst1 - tst) you would not need to trim the start
|
|
|
|
|
Hi All,
am using VB.NEt 2.0 ,I have some promlem to display the values on List box Control.
am getting this type of error
Complex DataBinding accepts as a data source either an IList or an IListSource.
My Code is
Private Sub loadEmpValues()
lbxEmpValues.datasource = o_ima.getdata.tables()
lbxEmpValues.Displaymember = "VALUES"
End Sub
Regards
Vidhish
|
|
|
|
|
vidhish wrote: lbxEmpValues.datasource = o_ima.getdata.tables()
Looks like you are trying to bind the listbox to possibly multiple tables(therefore complex binding).
What type does getdata return, presumably a dataset which is Ok for a datagrid but not for a listbox.
Ok so I never use a listbox
Bind a SINGLE table to the listbox, then set the display and value members to the appropriate fields in the table. Looks like you treat it like a combobox withut the drop down!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Private Sub loadEmpValues()
lbxEmpValues.datasource = o_ima.getdata.tables(0)
lbxEmpValues.Displaymember = "VALUES"
End Sub
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Hi All,
am using VB.NEt 2.0 ,I have some promlem to display the values on List box Control.
am getting this type of error
Complex DataBinding accepts as a data source either an IList or an IListSource.
My Code is
Private Sub loadEmpValues()
lbxstatus.datasource = o_ima.getdata.tables()
lbxEmpValues.Displaymember = "DESCRIPTION"
End Sub
Regards
Vidhish
|
|
|
|
|
Oh and try and refrain from double posting, it only irritates people and will require you to get a flame proof suit if you persist!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dear gents
I am updating a dataset dynamically using a for loop. When the loop is executed each time, it will fetch some rows from the database and update the dataset.
My requirement is i wanna display only the first row after the end of each execution of loop.
datagridview1.datasource=ds.tables(3).rows(i)(0) is not working
Please help me ASAP
Ahamed Azeem
software Programmer
|
|
|
|
|
You might want to take a look at creating a view of the Dataset table, filter the view so that it only has the row(s) you want to display in the grid, and then assign the datasource of the grid to the view.
Something like...
Dim dView = New DataView(ds.Tables(3))
dView.RowFilter = "SomeKey = '" & ds.Tables(3).Rows(0)("KeyColumnName") & "'"
datagridview1.DataSource = dView
|
|
|
|
|
Language in use: Visual basic 2008
I am reading a COFF .out file using a binaryreader from within VB. After reading it, I am converting it to hexidecimal format.
However, the structure of the file is not apparent either before the conversion or after it. I am able to actually read some of the ASCII comments within the file. However, I am pretty sure there is address information available within the file along with data, probaby in a hex form or something similar.
Is there an easy way to determine the internal structure "or lack there of"? of a binary file using VB. I am confident this file has internal structure/sections of some sort because I have created a binary file and it is not recognized as a COFF file. Is there or can there be Crlf's within a binary file. If I try to read the file as a text file, all I get is one ASCII symbol "ASCII code 0xC1 or something similar".
I am trying to determine the format because I need to create a customized .out file that contains a serial number only and store that at the proper address location.
Usually, the COFF file is created on a development system and I believe the .out file also contains linker information. In this paritular case, the .out file is for programming a DSP and adding the serial number withn each DSP device. The development station or emulator package is not an option being as the solution needs to be an automated self-contained for use within a production environment.
"old forum members jump to conclusions, while others search for the real solutions."
|
|
|
|
|
Dennis,
Have you looked around on the 'net for anything on COFF files?
Jeff
|
|
|
|
|
Jeff,
Yes, I have spent hours and hours on google looking for information on COFF file formatting along with searching for .OUT and both of the above in every other flavor of search terms I could think of.
I am beginning to think that COFF is a proprietary format or something. The manufacturer of the DSP is Texas Instruments.
Some web sites, I have visited have stated that COFF is an obsolete format that was used back in the Unix days. They may not be talking about the same COFF. It is possible that I am not using the right search parameters. There was one reference to obtaing the coff format at TI but that turned out to be a disabled/dead link.
Dennis
"Life is short and the journey long" -DL
|
|
|
|
|
I recently found some information on the COff file format.
and I have started to parse some of the data from a byte array that holds the file contents.
However, when I display the data byte by byte I get the following as a short example: b5-60-8b-48-
If I do a conversion.hex(bitconverter.ToUint32 _(returnvalue,4)
I get the information reversed which makes sense. 488b60b5 being as the conversion.hex routine is starting at the high byte. I am just not certain this is how it should be interpreted in the file according to the following definition from the COFF format.
So, I do not know if I should be starting with byte 4,5,6,7 or the reverse 7,6,5,4
'---------------------------------
byte
Number Type Description
0–1 Unsigned short Version ID; indicates version of
COFF filestructure
2–3 Unsigned short Number of section headers
4–7 Integer Time and date stamp; indicates when the file
was created
8–11 Integer File pointer; contains the symbol table’s
starting address
12–15 Integer Number of entries in the symbol table
20–21 Unsigned short Target ID; magic number (0099h)
indicates the file can be executed in a C6000 system
xx-xxx (continued for several hundrd bytes...I think)
'----------------------------
Imports Microsoft.Visualbasic.FileIO
Imports System.IO
Imports System.Text
Dim StrTime As String
Dim StrCoff_Ver_ID, StrNum_Section_Headers As String
Dim ReturnValue As Byte()
Dim x as integer
'file is the binary COFF file being read
'Returnvalue is byte array of entire file contents
ReturnValue = FileSystem.ReadAllBytes(file)
x = 0
StrCoff_Ver_ID =
Conversion.Hex(BitConverter.ToUInt16(ReturnValue, x))
x = 4
StrTime =
Conversion.Hex(BitConverter.ToUInt32(ReturnValue, x))
question: can the byte order be easily reversed if neccessary? They refer to "big endian format" in the documentation. I think I know what this format is and how to handle it for a 2 byte chunk of code. (0c d0) However when it gets to a 4 byte chunk like the filesystem var then I'm not sure what the order is (0c d0 1f 4c) is it (1f 4c 0c d0) or (4c 1f d0 0c),etc. ??
modified on Sunday, August 24, 2008 4:41 PM
|
|
|
|
|
Hello !
I'm using SystemParametersInfo API to set desktop work area so 25 pixels on top are free... I do it like this :
SystemParametersInfo(SPI_SETWORKAREA, Nothing, area, SPIF_UPDATEANDSEND)
where SPIF_UPDATEANDSEND = SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE
and everything works! then my program is closed ... and everything stays that way for like 5 minutes. Then work area is restarted to full screen ... What can I do so work area that I set will be remembered at least until reboot ?
thanks
|
|
|
|
|
xx77abs wrote: and everything stays that way for like 5 minutes. Then work area is restarted to full screen ... What can I do so work area that I set will be remembered at least until reboot ?
Keep your code running. Once your code stops, that's it, the area you reserve is returned to the desktop.
|
|
|
|
|
wow, thanks I thought about that, but didn't try to do it ... So after I set workspace area, only thing I need to do is not close my program ...
thanks
|
|
|
|
|
Hiya,
I was just wondering how (if possible) to add a windows form to a DLL in Vb.net? I have searched on the internet for examples but havent found anything useful
Thanks,
Lloyd
P.S. May take me a while to reply, Im away for a while.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
You set the project as a dll assembly, and then create forms in the dll. Then make reference to that dll to use the forms. You will have to create the forms in the new project through code references to the dll assembly.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
You certainly can, however your entry point will be a class and not the form. I have a logon DLL that is used by all our apps for authentication, the whole thing (2 forms, 3 classes) is wrapped in a DLL. Works perfectly.
Never underestimate the power of human stupidity
RAH
|
|
|
|