|
|
Great. It works fine. Now i'm able to make the progressbar be a real progressbar which shows continously progress thanks a lot, wouldn't have get that by myself.
here's some example code how it could look like:
declaretion/definition:
Private Printer As System.Management.ManagementObject
Private PrinterSelect As New Management.SelectQuery("SELECT Name, PrinterStatus, DriverName, PortName, Comment, Local, Network, Default FROM Win32_Printer")
Private PrinterSummary As New Management.ManagementObjectSearcher(PrinterSelect)
Private PrinterCollection As Management.ManagementObjectCollection
Private observer As New Management.ManagementOperationObserver
Private completionHandler As New WMICompletionHandler
executing code:
PrinterCollection = Nothing
PrinterSummary.Get(observer)
PrinterCollection = PrinterSummary.Get()
While Not (completionHandler.IsComplete)
Application.DoEvents()
System.Threading.Thread.Sleep(500)
End While
For Each Printer In PrinterCollection
{...}
next printer
... it redraws the progressbar while executing the wmi query, too.
you need to add the completionhandler class, shown on that msdn page.
thanks again
|
|
|
|
|
I wanna ask easier way for an T-SQL Clause
Imagine a table AS following
CODE - TYPE - TOTAL<br />
1132 IN 100<br />
1134 IN 140<br />
1134 OUT 230<br />
1135 IN 240<br />
1135 OUT 50<br />
1136 IN 70<br />
1137 OUT 110
I need a sqlclause it will group by code and calculate Total, u have to multply OUT type with -1
the final table what i need to get is
CODE - TOTAL<br />
1132 100<br />
1134 -90<br />
1135 190<br />
1136 70<br />
1137 -110
I assume The clause like that
select CODE,SUM(If (TYPE='OUT',TOTAL*-1, TOTAL) from DETAILS<br />
group by CODE,TYPE Order by CODE
But something is missing
-- modified at 9:24 Monday 5th September, 2005
|
|
|
|
|
The correct sentence is:
select CODE, TOTAL = SUM(case when TYPE = 'OUT' then TOTAL * -1 else TOTAL end) from DETAILS
group by CODE Order by CODE
Regards,
Vidal Gutiérrez Ch.
|
|
|
|
|
|
hcmuns wrote:
Could you tell me what books like Real World .NET Application book
You want other books like this one ? Why not go to amazon.com and see what else they recommend ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I want to rotate the label control.I have searched but i have only got the solution to rotate the text appear on the label. So if anybody could help me in this regard then it will be pleasure for me.
Thanks
Premanand Jha
|
|
|
|
|
Have a look at:
http://www.codeproject.com/useritems/Vertical_Label.asp
it may be of help.
Bye
Briga
|
|
|
|
|
Hi
I am getting a error "Specified argument was out of the range of valid values.Parameter name: '-2147483648' is not a valid value for 'index'." When I was trying to set selected value property value for the combo box.
I have given the code for your reference.
With cboName
.DataSource = dtSource
.DisplayMember = strDisplayMember
.ValueMember = strValueMember
End With
cboName.SelectedValue = intCalibrateId.ToString
After binding the combo box member, I am setting the value to the selectedValue property.
Please findout where I have done a mistake and how to rectify this.
Thanks in advance
M. Rabeek Ahamed
|
|
|
|
|
hmm
Try out by putting the Selectedvalue property int he With-EndWith block
like,
With cboName
.DataSource = dtSource
.DisplayMember = strDisplayMember
.ValueMember = strValueMember
.SelectedValue = intCalibrateId.ToString
End With
If this doesnt work than check out for the intCalibrateId value....
and try without casting it to string.
_mubashir
|
|
|
|
|
Hi frends!
Im currently working on a project that should display a number of columns on a datagrid. However i've 2 columns in my database that are named "inbound" and "outbound" and have binary values; 1 if yes and 0 if no. Both cannot be "1" at the same time but both can become "0".
Well i got stuck right about there...what i did was i excluded those 2 columns from the grid and created 2 radio buttons for each. Wat i want to do now is when i click on, for example, "inbound" it only displays the rows which has "1" value in their inbound columns.
The simple and most obvious question is...how do i go about doing this?
Thanx for all your assistance!
Kampai!!!
|
|
|
|
|
You can filter your datasource dynamically, but in this case, it would be quicker to return three tables in your dataset, one with all records, and one for each of the two values, where it is true. Then you can rebind against the right table when someone clicks a radio button.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Short yet precise n accurate...thanx chris!
Kampai!!!
|
|
|
|
|
Problems:
(1) How to get dynamic “Crystal Report” data I mean I have 3 tables named as Job, JobDesc and Emp_Info’ there is a primary key name JobNo now I want that I pass sqldb command at run time and in where clause I pass the JobNo so then on the crystal report only data show which have given JobNo.
(2) How to set Multi-line Report in Crystal Report Detail Section. Like this:
(3) How to display custom date format (Sep-06-2005) in Crystal Report.
Job No Title Employee Id
_____________________________________________________
1 Dummy Dummy Title Dummy Title 001
2 Dummy Title Dummy Title Dummy 002
sdfshdkfsdhkfshdkhs
3 Dummy Title Dummy Title Title 003
_______________________________________________________
I mean which property I have to change in order to get this kind of look.
Sample code can be fine at:
http://sktech.freewebspace.com/My%20Problems/[^]
Yours sincerely,
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
I have a Multi Line Textbox. User will input address information.I wantta set cursor to new line, when user press enter key. I try following code to achive but it always set cursor to first line. what do u offer me :S
protected sub txtAddress_KeyUp(........) handles txtaddress.keyup<br />
if e.key= keys.enter then <br />
txtaddress.text &= envoirenment.newline<br />
endif<br />
end sub
-- modified at 4:17 Monday 5th September, 2005
|
|
|
|
|
You're doing it the hard way. Why not just set the AcceptsReturn property of the TextBox to True? It'll accept the Enter key as a newline by itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I solve problem : AcceptReturns=TRUE is OK
|
|
|
|
|
hello all,
any one know, how to develop OCR in VB.NET
thanx
|
|
|
|
|
In theory, I guess you could do this, but why not use a language more suited to this sort of work ( that would be C++ ).
Amazon has some good books on this. It's just not the sort of question that can be answered in a reply to an online forum.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
2 questions:
1st, how can you open a binary data file in vb.net?
2nd, is there anyway of working out the structure of the binary file, the formatting of data inside it i mean?
I have a data file for a program and I'm interested in editting it. I'm guessing its a binary file.
Any ideas?
|
|
|
|
|
andymknight wrote:
1st, how can you open a binary data file in vb.net?
With a BinaryReader.
andymknight wrote:
2nd, is there anyway of working out the structure of the binary file, the formatting of data inside it i mean?
Two ways spring to mind - first you can check the file extension and assume it is valid, second you can read the file and compare it to known file formats to see if it matches any of them.
andymknight wrote:
I have a data file for a program and I'm interested in editting it. I'm guessing its a binary file.
Wow - that's vague ? What does it contain ? Why do you need to edit it ? Have you tried opening it with notepad or a hex editor to see what's inside ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It wont be any recognisable format. Its a data file for a game, which contains events.
I'm hoping to be able to access this data to build an addon to analyse the data.
Viewing it in notepad shows no reasonable structure, as it use unreadable ascii codes.
|
|
|
|
|
In that case, if the format is unknown ( have you tried google ? ) then the logical next step is to grab a hex editor, then edit the file, one byte at a time, and see what changes in the game, so you can document the file format. Remember to try more than one file, it's very possible that a byte number x = no. of lives approach won't actually work, the file format may well be looser than that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ouch, this could potentionally be months and months of pain steaking interrogation.
|
|
|
|
|
yep, I'm afraid so...
Christian Graus - Microsoft MVP - C++
|
|
|
|