|
Hi,
I have made an irregularly shaped control to which I want to add a drop shadow (like the one XP menus and the mouse cursor have). Is there any way to do this?
Thanks,
Ahmad
|
|
|
|
|
one way to do this (a bit clumsy dough) is just to duplicate the control put its color a bit darker (or total dark depending on what you want) and then put it behind the other control.
there's probably a beter way to do this but this is one way
perhaps an other way would be to create a usercontrol and draw the whole thing yourself
(put the region of the uc to the irregularly shaped path)
down side with this is that when users click the drop shadow it will fire the click event of the uc (but it is a bit less clumpsy then methode 1)
|
|
|
|
|
there is a problem in sql query.
there are following records of integer type in the table
2
3
4
5
6
7
8
in a paticular case i am getting fourth record i'e 5
now i want it's previous record i'e 4.
is it possible by the query.o i need to implement it progamatically.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
can u explain in brief ur question.
Exactly what do u want pls explain in brief.
|
|
|
|
|
She wants the previous record of a given record by ID.
i.e. if you have rows
1
3
5
7
and the given row was 7, she wants row 5.
|
|
|
|
|
Hi Sonia
To get the previous record:
select * from MyTable where ID in (select max(ID) from MyTable where ID < 5) For the next record:
select * from MyTable where ID in (select min(ID) from MyTable where ID > 5) Regards
Andy
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
Neat code - You have bypassed using group by and used subqueries instead and I wonder if this is more expensive CPU-wise than group by?
Do you know if this is the case?
I realise using group by would create more code.
Yours - trying not to be too nerdy
Guy
You always pass failure on the way to success.
|
|
|
|
|
Depending on the indexes available, SQL-Server would normally resolve the sub-query straight from an index. Then do a (probably clustered) index lookup to obtain the single resulting row.
How would you do this using a "group by" clause? I can't think of any way that would be as efficient as using a sub-query in the particular case.
|
|
|
|
|
Hats off to you I could not manage to code this with an aggregate query.
Guy
You always pass failure on the way to success.
|
|
|
|
|
Hi all,
How can i convert my text file(sample.txt) to html format....
any suggestions will be appreciated...........
thanks in advance............
sebastian
|
|
|
|
|
depending on wether or not your text file has the correct html format you could do this like so:
if the txt has the correct format just copy the file with the html extension
if not you'll need to create a new file (textwriter) insert the correct format
inbetween you read the original txt file and insert it into the new one (possible in a label or so) then save it with the html extension
hope this helps
|
|
|
|
|
Thank you very much
seabstian
|
|
|
|
|
hi i have created a main page with username and password (not a web page), i want to know how am i suppose to save this password and username in the database. so everytime i login, i need to type my password and username to enter the next page..
1. on the first time i login i dont need a password and username but once i'm login i need to set a password and username so i can use them the next time. is that possible?
2. can i know the coding to validate this pass and username..
pls help!!!
|
|
|
|
|
1. first check if the username is present in the database
if so go to 2.;P
if not insert a new record in db with username and password (make username unique value in db otherwise you might have problems)
2. this is depending on wether or not you want to encrypt the password
if not you just compare 2 strings (password is saved as a readable string in db)
if txtusername.text.tolower.equals(db.username.tolower) then
if txtpassword.text.tolower.equals(db.password.tolower) then
end if
end if
if you do want to use encrypted password its a bit more difficult but I have the code somewhere if you need it I'll look for it
just let me know
hope this helps
-- modified at 9:44 Monday 23rd July, 2007
|
|
|
|
|
thank you so much that helped a lot
|
|
|
|
|
hi All
i have installed Visual Studio 2003, and have installed all packages for all languages, but am only interested in VB.NET. when i drop a textbox on my form, or when i try to run my previous Programs, it gives me the Following error,
<br />
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll<br />
Additional information: Overflow or underflow in the arithmetic operation.<br />
<br />
And this Error will point to the textbox and button i dropped on the form
please
Vuyiswa Maseko
|
|
|
|
|
You need to provide the code thats throwing the error.
|
|
|
|
|
i have not Written a code to my Project,so i cant posts any code becode there i none.
if you can Google the Error i have sent, you will see that many people had the Problem and if you read through the threads,you will not find the solution, those thread have no solution. some say "Reinstall framework 1.1, some say its a worm. but all this happens after you install your OS from scrach(XP) and SQL2000,and a AVG antispyware.
Please Google and see the threads you will see what am talking about, one user in one thread, "Mention it as a Bug,but talked it out with out of Microsoft People and they had no answer, they think is a Conflict software install before VS or After. in my case am suspecting AVG antispyware,
Vuyiswa Maseko
|
|
|
|
|
When i write the array into the text file, it will automatically create the space in between first line and second line. Any ideas how come it behaves like this? How to write into the text file line by line without the space in between the line?
|
|
|
|
|
can you give me you're code you use to write to the text file.
sounds to me you've added 1 vbcrlf to many in wich case you would get that behavior
|
|
|
|
|
Here are the coding inside the class
Dim delimiter As String<br />
delimiter = " "<br />
<br />
Dim columnsplit() = Split(SplitTextLineContent, delimiter)<br />
<br />
<br />
Dim j As Integer<br />
Dim content As String<br />
content = " "<br />
<br />
For j = 0 To UBound(columnsplit)<br />
<br />
Dim objConvertText As ConvertText 'obj means object<br />
objConvertText = New ConvertText 'create new object from class<br />
<br />
content += (columnsplit(j)) & " "<br />
<br />
objConvertText.WritetoFile(content)<br />
<br />
Next j
Here are the function:
Public Function WritetoFile(ByVal content As String)<br />
<br />
Dim File_TO_CREATE As String = "c:\a.txt"<br />
<br />
'declare to create the file<br />
Dim oWrite As System.IO.StreamWriter<br />
oWrite = System.IO.File.CreateText(File_TO_CREATE)<br />
<br />
oWrite.WriteLine(content)<br />
<br />
oWrite.Close()<br />
<br />
WritetoFile = content<br />
<br />
End Function
|
|
|
|
|
Ok I see a few possible problems with this code:
1) for each string that you split you recreate you're textfile (you call the function writetofile in you're for lus this is not needed and will only consume rescourses
just put
sweehin18 wrote: Dim objConvertText As ConvertText 'obj means object
objConvertText = New ConvertText 'create new object from class
sweehin18 wrote: objConvertText.WritetoFile(content)
behind the for lus
2) in you're writetofile function you use owrite.writeline(content) this will always automaticly create a new line if you don't want this use owrite.write(content)
(this is probably the cause of you're problem)
hope this helps
|
|
|
|
|
The content string you are assembling will always start and end with a space;
splitting it by space will result in an empty first and empty last item, each generating
an empty line.
Solution: trim content variable !
|
|
|
|
|
To make the text write from first line to second line, I use VbNewLine. However, it will write from first line to third line or even fourth line. In between the line, the blank lines are exists. Even i use trim, the problem still exists. Anyone can help?
|
|
|
|
|
you start with
content = " "
why ? that's already one empty line explained
For j = 0 To UBound(columnsplit)
...
content += (columnsplit(j)) & " "
so you end on a space too
that's another empty line explained
solution: trim content variable !
|
|
|
|