|
If you could provide the code you used for the transparancy of the form, it would help me to understand the problem much better.
Thanks.
|
|
|
|
|
I didnt create it through code. What i did was, i created a BMP image and
set it as my forms background. Some of the bmp is yellow, set to be my transparent
part. I just set the forms property "Transparency Key" = Yellow
It works on my development computer but when i install it on another the yellow
part shows up. Ive already given up on this but if you can figure it out i will
sing at your wedding or do something. Thank you
|
|
|
|
|
Is is possible to send/receive data calls using the PCCSDK ? If so, does anyone
have any examples, and if not, waht is the best way to accomplish it.
|
|
|
|
|
I am subclassing a VB ListBox so that depending on whether my item in a listbox linked to a collection and the HasData property of the linked item in the collection is TRUE then set the ListItem to display coloured red and in italics. This all works as planned, except that I want to also display the CheckBox to the left of the items text. Because I am drawing the item text myself (so that I can set the font and colour) I cannot see how to get the CheckBox to also be displayed.
Could some kind person please explain how I can display the CheckBox as well.
My Subclassing code is as follows:
Public Function WindowsWndProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long<br />
<br />
<br />
Select Case uMsg<br />
<br />
Case WM_DRAWITEM<br />
<br />
'<br />
' This is only called for the ListBox on the frmClaimsSelection.<br />
' I tried to access the name of the class of the control<br />
' but that didn't seem to work. If anyone has any ideas let me know.<br />
'<br />
<br />
Dim strClass As String<br />
Dim sz As Long<br />
Dim DIS As DRAWITEMSTRUCT<br />
Dim CWP As CWPSTRUCT<br />
Dim sString As String<br />
Dim lRet As Long<br />
Dim lFont As Long<br />
Dim nHeight As Long<br />
Dim tSize As SIZE<br />
Dim fdwItalic As Long<br />
Dim lpszFace As String<br />
Dim lCount As Long<br />
<br />
lpszFace = "MS Sans Serif"<br />
fdwItalic = 1<br />
nHeight = 8<br />
<br />
Call CopyMemory(CWP, ByVal lParam, LenB(CWP))<br />
Call CopyMemory(DIS, ByVal lParam, Len(DIS))<br />
<br />
'<br />
' Get name of class of window of the control being drawn<br />
'<br />
sz = GetClassName(CWP.hwnd, ByVal strClass, 128)<br />
strClass = Left$(strClass, sz)<br />
<br />
' Select Case strClass ' See above comment.<br />
'<br />
' Case "ThunderListBox"<br />
' With DIS<br />
'<br />
' End With<br />
'<br />
' End Select<br />
<br />
With DIS<br />
'<br />
' Get the text, indicated by DrawItemStruct.iItemID,<br />
' from the listbox.<br />
'<br />
sString = Space$(128)<br />
lRet = SendMessage(.hwndItem, LB_GETTEXT, .itemID, ByVal sString)<br />
sString = Left$(sString, lRet)<br />
<br />
' Get the collection of claims, so that we can check if the<br />
' claims items has been generated by existance of Taxpoint data,<br />
' if it hasn't then display in italics and colured.<br />
If MainForm.ClaimsSelectionForm.ClaimsSelectionCollection(DIS.itemID).HasData Then<br />
fdwItalic = 1<br />
Else<br />
fdwItalic = 0<br />
End If<br />
<br />
<br />
<br />
'<br />
' Create a logical font based on the font specified<br />
' in the listbox.<br />
'<br />
lFont = CreateFont(nHeight, 0, 0, 0, 0, fdwItalic, 0, 0, 0, 0, 0, 0, 0, lpszFace)<br />
'<br />
' Select the font into the new device context.<br />
' Compute the width and height of a string of text.<br />
' Set the height of the listbox item accordingly.<br />
'<br />
Call SelectObject(.hdc, lFont)<br />
Call GetTextExtentPoint32(.hdc, sString, Len(sString), tSize)<br />
<br />
Call SendMessage(.hwndItem, LB_SETITEMHEIGHT, .itemID, ByVal tSize.cy)<br />
'<br />
' Set the color of the text of the list item<br />
' based on whether the item is selected or not.<br />
'<br />
Call SetBkColor(.hdc, GetSysColor(COLOR_WINDOW))<br />
If fdwItalic Then<br />
Call SetTextColor(.hdc, &HFF&)<br />
Else<br />
Call SetTextColor(.hdc, GetSysColor(COLOR_WINDOWTEXT))<br />
End If<br />
<br />
<br />
End With<br />
'<br />
' Draw the text in the listbox.<br />
'<br />
With DIS.rcItem<br />
Call TextOut(DIS.hdc, .Left, .Top, sString, Len(sString))<br />
End With<br />
<br />
Call DeleteObject(lFont)<br />
WindowsWndProc = 0<br />
<br />
<br />
End Select<br />
<br />
<br />
End Function
|
|
|
|
|
Hi Everyone,
I'm in need of suggestions. I have this asp.net multiple combo box form that filters a datagrid. My dilemma is I have seven combos with begin and end range, and the user can select any combination no business rules given for the sequence. I have to build this SQL String on the fly but I'm finding myself using more if conditions than I care for has anyone done something like this in an elegant manner. Again there are no business rules that govern this filter screen. The only thing I have control of is to make sure a user doesn't hit submit and loads the entire dataset which is say something like 400,000 rows with 100+ columns being return.
Thanks in advance
|
|
|
|
|
I trying to replace abc to def(TextFile)
Private Sub Command1_Click()
Call WriteToTxt("FlatFile", 2, "abc", "def")
End Sub
Public Sub WriteToTxt(strTable As String, intField As Integer, strFind As String, strReplace As String)
Dim intFileHandle As Integer
Dim intFileHandle2 As Integer
Dim strRETP As String
Dim sFieldArray As Variant
Dim found As Boolean
found = False
intFileHandle = FreeFile
Open "C:\" & strTable & ".txt" For Input As #intFileHandle
intFileHandle2 = FreeFile
Open "C:\" & strTable & ".txt.tmp" For Output As #intFileHandle2 ' temp file
While Not EOF(intFileHandle)
Line Input #intFileHandle, strRETP
If Not found Then
FieldArray = Split(strRETP, "|")
If FieldArray(0) = strFind Then (Im geting Error on this line saying Subscript out of range)
FieldArray(intField) = strReplace
strRETP = Join(FieldArray, "|")
found = True
End If
End If
Print #intFileHandle2, strRETP
Wend
Close #intFileHandle
Close #intFileHandle2
Kill "C:\" & strTable & ".txt" ' delete original
Name "C:\" & strTable & ".txt.tmp" As "C:\" & strTable & ".txt" ' rename temp file
End Sub
|
|
|
|
|
Hi;
This is what is happening in your code snipped.
The error is not happening on the line that the debugger lead you to believe, it is on the next line of code “FieldArray(intField) = strReplace”. What I believe is happening is that in the file FlatFile.txt you have a line that may read as “abc|???” and when the line “FieldArray = Split(strRETP, "|")” executes FieldArray looks like this
FieldArray(0) = “abc”
FieldArray(1) = “???”
so when the program executes the line “FieldArray(intField) = strReplace” it fails with Subscript out of range because intField has a value of 2 but the valid index into FieldArray are 0 and 1. This is what is known as off by one error. Index on an array start at zero not one.
I hope this has been of some help.
-Fernando Soto
|
|
|
|
|
Actually, he's getting the error on the correct line. Split will return an array no matter what. But, if it is executed on an empty string, the array will be returned with no elements in it. This will result in an out of bounds exception if you try to access any element in the array, even if the indexer used is 0, since there are no elements in the array.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You are correct that is a possibility. But once he checks for blank lines he will run into the next problem, off by 1 error.
|
|
|
|
|
This is the documented result of running Split on an empty string. Split will return an array that has no entries in it at all. Enclose your split code in an error handler or check to see if strRETP is empty before running split on it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have never run into this before, maybe you have an answer for me.
I built a script that will send a remote command window to a computer, for the configuration of the Dell Remote Access Card.
Obviously, SERVER, is my variable for the remote computer I want to connect to, and PASSWORD, is my variable for the password I want to set for the account.
The part where I need to use my PASSWORD variable is where I have issues. If I wscript.echo the line back, it is literally putting “ & PASSWORD & “ as my command to be issued. I need my variable PASSWORD in quotes, plus the quote at the end for the command being issued.
------------------------------------------------------------
Set objWMIService = GetObject ("winmgmts:\\" & SERVER & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create ("cmd /k racadm config -g cfgUserAdmin -o cfgUserAdminPassword -i 2 "" & PASSWORD & """, Null, Null, intProcessID)
------------------------------------------------------------
|
|
|
|
|
Your line should read like this: (watch VERY carefully!)
errReturn = objWMIService.Create ("cmd /k racadm config -g cfgUserAdmin -o cfgUserAdminPassword -i 2 """ & PASSWORD & """, Null, Null, intProcessID)
Three quotes on both sides of the PASSSWORD injection. The first two quotes translate to a literal " character in the string. The next quote will terminate the literal string. Then, of course, your PASSWORD string gets appended. The the first quote starts a new string literal, the first character of which is a ", represented by the two quotes characters immediately following each other.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dim com As New OleDbCommand(ComStr + tabname, con1)
Dim OleDap As New OleDbDataAdapter()
OleDap.SelectCommand = com
Dim ds1 As New DataSet()
dim DT as datatble
DT = con1.GetOleDbSchemaTable(OleDbSchemaGuid.Primary_Keys, New Object() {Nothing, Nothing, tabname, "table"})
Label1.Text = DT.Rows(0).Item(0).ToString
con1.Close()
There is an error in this code.
Error: "Invalid Parameters"
Please help.
Thanks in advnce.
|
|
|
|
|
|
Here is the code
dim con1 as new oledbconnection(..connection string..)
Dim DT As DataTable
con1.open
DT = con1.GetOleDbSchemaTable(OleDbSchemaGuid.Primary_Keys, New Object() {Nothing, Nothing, tabname, "table"})
Label1.Text = DT.Rows(0).Item(0).ToString
datagrid1.datasource = DT
con1.Close()
It gives runtime error "Invalid Parameters"
Please help.
|
|
|
|
|
|
Sir, can you please let me know the code to do the needful.
I will be highly obliged.
Thanks.
|
|
|
|
|
I have upgraded a big program from VB6 to VB.NET. The program draws
and writes on some picturebox.
1) I have not well understood how to upgrade the AutoRedraw feature.
Documentation speaks sometimes about the OnPaint method of the form,
to be overridden with some refreshing instructions, sometimes about
the Paint event. For the time being I am obliged to utilise a
CommandButton triggering a refreshing routine in order to restore the
graphics when, for some unknwown reason, it disappears leaving a blank
page.
2) The ToolTip textbox has a strange behaviour on my picturebox: first
time it is displayed and then moved, the underlying graphics is not
restored. Subsequent appearance of the textbox runs correctly
Any help available?
Thank you
Leonardo Presciuttini
|
|
|
|
|
how do i send SMS from landline to cell phone in VB6
|
|
|
|
|
Google for "VB6 SMS"[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know anything about AppConfig files and how to integrate them into a SQL application because it is the only way i can think of to install my app on other computers and somewhat painlessly setup the connection string for the app. I know nothing about XML. HELP ME
|
|
|
|
|
Right click on your project, select "Add -> New Item" and select "Application Configuration File". Make sure it is called "App.Config".
On your application drag from the toolbar to your form a "SqlConnection" object. View properties of SqlConnection object and select "Dynamic Properties" then Check the default "Connection String".
Next, create a connection string and save all.
By now you should see in "App.Config" a key value pair that is added for your SqlConnection object and its connection string.
To read from your code:
using System.Configuration
myConnectionString = ConfigurationSettings.AppSettings("your key name")
|
|
|
|
|
I you want to do this in code (versus the IDE) let me know, or, if you need XML that you can read AND write from code (like by screens from user input) let me know.
I have some real-work examples.
If the IDE workds for you - great.
Good luck - Len
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
This is how u have to place ur connectionstring in your app.config file.
<configuration>
<appSettings>
<add key="DBConnString" value="Data Source=ervername;Initial Catalog=Databasename;User ID=userid;Password=password;"/>
</appSettings>
</configuration>
For accessing this value from DB you can use this line of code in vb.net (in case of C# hope u can manage it, or ask me)
Public Shared CONNECTSTRING As String = System.Configuration.ConfigurationSettings.AppSettings("DBConnString")
Hope its fine and ur prob is solved.
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|
|
|
|
|
|
i m trying to stream media files on VB.NET interface using Windows Media Player component.. but its not being played..
well, i hav tried embedding the windows media player component on the WebApplication.....it is appearing on the client side but it is not able to play any files...... and we are not able to even select any controls provided in the player...
we are using Windows 2000 Advanced Server as OS.
actually we dont ve much idea about how streaming takes place on the internet and do we need to add any other codec or component to achieve Media Streaming ???
waiting for replies.
thanks..
|
|
|
|
|