|
Have you ever used the pure Windows API? There's a function called EnumChildWindows() that will help you out. I found a VB example online to help you get started...
http://www.syix.com/wpsjr1/EnumChildWindows.zip[^]
Jeremy Falcon
Imputek
<nobr>Excrement escapes everyone - even elders.
|
|
|
|
|
I got .NET Enterprise Architect Edition installed in my machine.
Every time I try load a new project the application closes down without giving any error message but that project is somehow saved in the project list. Then when I re-start the .NET and open one of the saved projects and try to add a new windows form, again the application closes down.
I tried repairing the .NET but same thing kept on happening.
I tried re installing .NET but same thing kept happening.
I didn't try reinstalling the OS and then installing .NET.
I'm having a Intel P4 with 256 Ram running Windows 2000 professional edition.
Why is this problem pertaining?
kind rgds
|
|
|
|
|
I has terrible problems with the IDE but did two thing and it's been ok since.
1.Defragged and consolidation my drive
2.Put Service Pack 3 on.
Don't know if it will help but you can give it a go.
|
|
|
|
|
I tried by installing the service pack 2 but still the problem is there.
Is there any others solutions? Pls help.
Thanks.
A.Aluthwala
|
|
|
|
|
<br />
...<br />
intDy = Int(lngCs / 86400) ' lngCS = 404090, intDy = 4<br />
lngCs = lngCs - (intDy * 86400) ' no overflow, lngCs = 58490<br />
intHr = Int(lngCs / 3600) ' intHr = 16<br />
lngCs = lngCs - (intHr * 3600) ' overflow here, WTF?!?<br />
...<br />
How come the VB runtime can process int * 86400 but when it tries to multiply int * 3600 it gets an overflow? Is this just completely insane, or am I missing something?
"You only disagree because you're a moron. If you were a man of intelligence you would see that I'm obviously right." - The General Consensus
|
|
|
|
|
86400 is treated as a Long while 3600 is treated as an Integer
In the first case, the temporary is stored in a Long. The temporary result of the second one is stored in an Integer causing an overflow.
Try:
lngCs = lngCs - (intHr * CLng(3600))
|
|
|
|
|
Yeah. I guess. It was easier just to change the intHr to a Long though.
"You only disagree because you're a moron. If you were a man of intelligence you would see that I'm obviously right." - The General Consensus
|
|
|
|
|
I tried the following code below which is given in msdn.
But i am not getting any button on the toolbar.
Can anyone tell why.
applicationObject = CType(application, EnvDTE.DTE)
addInInstance = CType(addInInst, EnvDTE.AddIn)
If connectMode = Extensibility.ext_ConnectMode.ext_cm_UISetup Then
Dim objAddIn As AddIn = CType(addInInst, AddIn)
Dim CommandObj As Command
' When run, the Add-in wizard prepared the registry for the Add-in.
' At a later time, the Add-in or its commands may become unavailable for reasons such as:
' 1) You moved this project to a computer other than which is was originally created on.
' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
' 3) You add new commands or modify commands already defined.
' You will need to re-register the Add-in by building the MyAddin1Setup project,
' right-clicking the project in the Solution Explorer, and then choosing install.
' Alternatively, you could execute the ReCreateCommands.reg file the Add-in Wizard generated in
' the project directory, or run 'devenv /setup' from a command prompt.
Try
Dim cmds As Commands
Dim cmdobj As Command
Dim customin, customout As Object
Dim cmdbarobj As CommandBar
Dim colAddins As AddIns
' Set references.
Dim DTE As EnvDTE.DTEClass
colAddins = DTE.AddIns()
cmds = DTE.Commands
cmdobj = cmds.Item("File.NewFile")
' Create a toolbar and add the File.NewFile command to it.
cmdbarobj = cmds.AddCommandBar("Mycmdbar", vsCommandBarType.vsCommandBarTypeToolbar)
MsgBox("Commandbar name: " & cmdbarobj.Name)
cmdobj = cmds.AddNamedCommand(colAddins.Item(1), "mycommand", "mycommand", "tooltip for mycommand", True)
|
|
|
|
|
Hi,
Please I need help.
I created a form that allows me searching customers by name. after display customers list in datagrid, i want allow user to select one customer by pressing key.
for grid setup, i tried the following code :
'Configuration de la grille
Private Sub DataGridSetup()
Dim ts As New DataGridTableStyle()
Dim cs As New DataGridTextBoxColumn()
AddHandler cs.TextBox.KeyPress, AddressOf CellKeyPress
DataGrid1.ContextMenu = ContextMenu1
DataGrid1.CaptionText = "Résultat"
ts.MappingName = "mycli"
cs.MappingName = "c_cli"
cs.HeaderText = "Code"
cs.Alignment = HorizontalAlignment.Center
ts.GridColumnStyles.Add(cs)
cs = New DataGridTextBoxColumn()
cs.MappingName = "N_cli"
cs.HeaderText = "Nom/Raison sociale"
ts.GridColumnStyles.Add(cs)
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
End Sub
and i added handler to datagridtextboxcolumn, for detecting the keypress events as follows :
'Ajout d'un évènement aux cellules
Public Sub CellKeyPress(ByVal Sender As Object, ByVal e As KeyPressEventArgs)
Dim dt As DataTable = ds.Tables("mycli")
Dim p As Integer
CodeClient = Space(11)
If e.KeyChar = Chr(13) Then
p = Me.BindingContext(ds, "mycli").Position
CodeClient = dt.Rows(p)("c_cli")
Me.Close()
End If
End Sub
So after writing this code, i can select one customer only after pressing SHIFT+RETURN.
please can you explain me way i must first press
SHIFT.
Thank you very match.
* *
*
* *
|
|
|
|
|
intibnin wrote:
please can you explain me way i must first press
SHIFT.
I think this something to do with the KeyPress event, but I can't remember what
Anyway, you can bypass all this by just using the KeyDown instead of the KeyPress event, then use KeyCode instead of the KeyChar. It should work then
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Hi, I'm iusing a Do..until loop to receive data from a modem, one of the conditions for the loop to finish is a boolean variable (bTimeOut), assined to TRUE when then Timer finish is count, i did like:
Settings.bTimeOut = False
Settings.Timer1.Enabled = True
Do
If Main.MSComm1.InBufferCount Then Buffer = Buffer & Main.MSComm1.Input
Loop Until (InStr(1, Buffer, Res & vbCrLf) Or (Settings.bTimeOut = True))
Settings.Timer1.Enabled = False
Settings.bTimeOut = False
The problem is that if, the modem answer is not like Res, the loop never ends, i cannot understand why does the Timer do not change my variable state, its function is like:
Public Sub Timer1_Timer()
bTimeOut = True
Timer1.Enabled = False
End Sub
Can anyone help me with this?
Thank you for your time
Rui
|
|
|
|
|
Have you checked that Settings.bTimeOut is actually being set? Add a watch to the Settings.bTimeOut in the loop and see if it's being set.
|
|
|
|
|
Thank you LeeDavies for your answer!
Yes, i tried checking the variable state during the loop, i even tried a MsgBox inside the Timer1 function, just to know if it was working!
The Timer interval is 2000, instead it never displays the MsgBox, can't understand why...
Could it be because, i keep reading from the modem..???
Rui
|
|
|
|
|
It's been staring me in the face all the time. The timer is not being started.
It should be timer1.Start and Timer1.Stop, not Timer1.enabled = true
|
|
|
|
|
hi ,
when form1 is loaded menuitem3 is disabled.
but when one clicks button1 in form2 the menuitem3 of form1 should get enabled ..
the code compiles successfully but it doesnt works as it should..
plz have a look
--bye
Aakash
|
|
|
|
|
I couldn't see your code, but you should try something like...
Form1.menuitem3.Enabled = True ...from Form2.
Jeremy Falcon
Imputek
<nobr>Excrement escapes everyone - even elders.
|
|
|
|
|
Friends,
I am very new to programming and have started with a new project which consist of a form which has 2 calander controls. I wanted to know how can I fetch data that was inputed into a database between two dates and show it into a grid. the date selection is dynamic. Any help will be appreicated.
|
|
|
|
|
look ,
when the data (date) is inside the database then u cant fetch it which lies between two dates.
1) first take the first calendar control of the form in one variable.
2) take the second calendar control date of the form in 2nd variable.
3) fetch the date from the database by binding it with a variable using a SELECT query and then match the third variable with the above 1st and 2nd variable and see if it lies between two the only display it.
--bye
|
|
|
|
|
Hi..
I posted this article as a reply to your answer ..
it also can help ather beginners..
click hte link to view the article with source code..
|
|
|
|
|
Hello HSPC
Thanks for the link to your article , I will work on it , Incase i encounter any problems , would you be able to assist me.
Thank you
Pras
|
|
|
|
|
sure..
if I have the time and the enough knoledge
please send any comments you think about the article and rate it..
|
|
|
|
|
Hi all..
I use the web browser control on a vb6 form ..
the problem is :
if the user choosed to work offline (from Internet Explorer) the (connect / stay offline)dialog appears as soon as the form loads (before i try to navigate any page)
I want to prevent this from happenning ..
any suggestions?
|
|
|
|
|
Try stopping the browser firing till your ready. Look Here
|
|
|
|
|
Dim RS As AdodB.Recordset
Set RS = New AdodB.Recordset
Dim intCurrentRecord As Integer
Dim iOrderNo As String
Dim strProductCode As String
Dim strDesc As String
Dim iQuantity As Integer
Dim iPrice As Integer
iOrderNo = txtOrderNo.Text
strProductCode = Adodc3.RS("ProductCode")
strDesc = Adodc3.RS("ProductDesc")
iQuantity = Adodc3.RS("Quantity")
iPrice = Adodc3.RS("Price")
With intCurrentRecord
Dim editSQL As String
editSQL = "update OrderDetail set ProductCode = '" & strProductCode & "', ProductDesc = '" & strDesc & "', Quantity = " & iQuantity & ", Price = " & iPrice & ""
Set RS = Conn.Execute(editSQL)
End With
the (intended) purpose of the above code is that when the user pressed the edit button, having changed the details of the current record in the datagrid, that the SQL statement would execute the update. however, i am not referring to this current record properly, it is not recognising it, throwing an error of "method or data member not found", what can i do to fix this? thank you!
|
|
|
|
|
I wrote a multi page tiff editor. User can draw rectangles and delete pages. Another function is that you can convert .tiff files to PDF. I used Acrobat plug in for that. Every thing worlks fine. But the problem is that sometimes when the conversion is done, some random pages background is black in PDf. Can't figure out if is an Acrobat conversion issue or .Tiff issue when it is edited. If anyone had this problem, please let me know. Thanks a lot.
Zulfikar Ali
|
|
|
|