|
Hello there
I have created on application and I wanted to put some graphics on button. the problem is when I place the icons on some forms they are coming and on some forms they are not. I checked every property of Button and form to locate the difference and except for the name nothing is different but the icons are bit choosy to decide on which screen they want to come. Same is happening with Toolbar I placed. having 11 buttons and only 7 are displaying the icons.... and rest have nothing on it.
I tried with image list and with out image list on buttons..
Any solution for this bug
Rizwan Bashir
|
|
|
|
|
If you are using visual styles and you set the FlatStyle to System on a button the image will not be drawn.
Hope this helps
Tom
|
|
|
|
|
here is a snip of code i'm playing with
Dim strSearch As String<br />
strSearch = txtSearch.Text<br />
Dim Cnxn As New ADODB.Connection<br />
Dim rstNotes As New ADODB.Recordset<br />
Dim strCnxn As String<br />
Dim strSQLSearch As String<br />
<br />
' record variables<br />
Dim mark As Variant<br />
Dim count As Integer<br />
<br />
Set Cnxn = New ADODB.Connection<br />
strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\RMSC LOGIN\Exhibits.mdb;Persist Security Info=False"<br />
' open recordset with default parameters which are<br />
' sufficient to search forward through a Recordset<br />
Cnxn.Open strCnxn<br />
Set rstNotes = New ADODB.Recordset<br />
strSQLSearch = "SELECT * FROM Email "<br />
rstNotes.Open strSQLSearch, Cnxn, adOpenStatic, adLockReadOnly, adCmdText<br />
<br />
count = 0<br />
rstNotes.Find "Notes LIKE '" & strSearch & "'"<br />
<br />
Do While Not rstNotes.EOF<br />
'continue if last find succeeded <br />
count = count + 1<br />
' note current position<br />
mark = rstNotes.Bookmark<br />
rstNotes.Find "Notes LIKE 'strSearch'", 1, adSearchForward, mark<br />
' above code skips current record to avoid finding the same row repeatedly;<br />
' last arg (bookmark) is redundant because Find searches from current position<br />
Loop<br />
<br />
'txtMessage.Text = rstNotes <---not sure about this<br />
' clean up<br />
rstNotes.Close<br />
Cnxn.Close<br />
Set rstNotes = Nothing<br />
Set Cnxn = Nothing<br />
Close<br />
it basically is supposed to search the recordset, for text that the user supplies which is the strSearch Varible.
Any help would be great.
|
|
|
|
|
You must have been reading the MSDN example for Recordset (looping to count number of instances) which I think is a very bad example.
Try to avoid looping through Recordset to get only specific record(s). In most cases it's much more efficient to modify your query to use SQL functions like COUNT, SUM, AVG, etc or specify a condition to get only the records you want.
Since I assume you only want to return one recordset, try modifying your SQL query into something like
"SELECT * FROM Email WHERE Notes LIKE '%" & strSearch & "%'"
You need the % as a wildcard for text before and after the search word(s).
This will return record(s) that match your query. If you only want one, use "SELECT TOP 1 * FROM..." instead.
If the recordset returns .EOF then there are no records found, otherwise simply display the data like this:
txtMessage.Text = rstNotes.Fields("FieldName")
I hope this helps
Edbert P.
Sydney, Australia.
|
|
|
|
|
Perfect That works great,
thank you for the help
|
|
|
|
|
Hi, i have a problem i an application i'm building in Visual Basic 2005 Beta 1, the thing is: when i try to update the access database, appears an error about some "InsertCommand" is missing, i'm using a code like the following:
Me.DVDsDataConnector.EndEdit()
Me.DVDsTableAdapter.update(Me.MyDVDCollection.DVDs)
and sometimes doesn't show the error but nothing happens, it doesn't update the database
what can i do?
|
|
|
|
|
You need to create the InsertCommand and assign it to your DataAdapter.
Basically this means you need to supply an SQL on how the data should be inserted into the database, e.g. "INSERT INTO DVD (DVDName) VALUES (@DVDName)".
You can use CommandBuilder to let .NET try to build an SQL script for you, but I recommend writing your own SQL so you know exactly what is changed in your database.
Have a look at this article[^] to find out more about InsertCommand.
I hope this helps
Edbert P.
Sydney, Australia.
|
|
|
|
|
Hello,
If I install Embedded Visual C++ on a machine that is already running Visual Studio .Net 2003, is there a possibility of something going wrong? (Would it damage the .Net CF in Visual Basic .Net 2003?)
Thanks
My sig:
"It isn't a bug, it's a feature I didn't know about." - Programmer2k4 (In case you didn't know - that's me! )
Oops, Programmer2k4 is now old...I should have thought about that a year in advance.
|
|
|
|
|
How can I get the SystemMenu Icons? The ones for Restore, Minimize, Maximize and Close?
Thanks,
Tim
|
|
|
|
|
mailing you one application which will extract all the system icons in the specified folder... check your mail with subject "mail from Rizwan"
Best Regards
Rizwan Bashir
Rizwan Bashir
|
|
|
|
|
Found the answer. They are actually part of the Marlett font.
|
|
|
|
|
Hi, I have some question related to my task in VB.NET. Those question are:
1. How to determine which row or value is select in a list view in VB.NET?
2. I have a button, I want it work when the user click on it, it would run a webpage (ex. when user click it point to www.codeproject.com) and open a default mail application to send mail to someone@codeproject.com.
3. How to create the splash screen in vb.net??? I try to use timer to close the current form (splash screen) and open the second form (the main form) but it display an error message. I used to do this method in VB6 and it is working very well. but I don't know who to do that in VB.Net after it raise a problem.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
The man from SCN-CO wrote:
1. How to determine which row or value is select in a list view in VB.NET?
Use the SelectedIndices and SelectedItems properties (as described in the documentation).
The man from SCN-CO wrote:
2. I have a button, I want it work when the user click on it, it would run a webpage (ex. when user click it point to www.codeproject.com) and open a default mail application to send mail to someone@codeproject.com.
Use the System.Diagnostics.Process class. These two calls will start the default application for internet browsing and sending mail, respectively:
Process.Start("http://www.codeproject.com")
Process.Start("mailto:someone@codeproject.com")
The man from SCN-CO wrote:
3. How to create the splash screen in vb.net???
Much has been written on this subject. I suggest googling for "VB.NET splash screen" and look through some of the samples.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Thank you very much for your comment. I will try it and if I have any problem I will let you know.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
i am creating a report with Access, i want to calculate the total time spend
for example x =Sum([Serv_Rec_Time_Spent])
x is 23:30 H for example, if i add 2 hours then x = 1:30 , instead of 25:30 hours
please i need help ASAP
|
|
|
|
|
in .net you can accomplish this pretty simply using the timespan structure.
Dim startTime As DateTime
Dim endTime As DateTime
Dim duration As TimeSpan
startTime = DateTime.Now
'--- code to generate your report, or any other process you want to time ---'
endTime = DateTime.Now
duration = endTime.Subtract(startTime)
hope this helps,
-jim
|
|
|
|
|
Well I am not calculating starting time and end time
For example I have 10 textbox each one has a different time
I just want to add them up so the total will not round up.
20:00 hours Plus 6:00 the total hours should be 26:00,
But coz it's time Elapsed, the total is 2:00 hours instead of 26:00 H
|
|
|
|
|
you can still use the timespan structure for this.
the only issue is that once you get above 24 hours, the hour portion of the time value is translated into a value representing a day/hour combination. in other words in your example above the resulting value would look like 1.02:00:00 meaning 1 day, 2 hours, 0 minutes, 0 seconds.
Dim timeOne As DateTime = DateTime.Parse("2004-01-14T12:00:00")
Dim timeTwo As DateTime = DateTime.Parse("2004-01-14T23:00:00")
Dim totalTime As TimeSpan
totalTime = New TimeSpan(timeOne.TimeOfDay.Ticks + timeTwo.TimeOfDay.Ticks)
messagebox.show(totaltime.tostring)
the result of this example would be 1.11:00:00 (1 day, 11 hours, 0 minutes, 0 seconds)
i don't know if this will work for you or not.
if you want to post some code maybe i can try to work something else out to help...
-jim
|
|
|
|
|
Hi Guru's,
How can i achieve this...............
There is a button on form1. On button clicking need to show form2 and close the form1(not to hide the form1)
Regards,
Ritesh
|
|
|
|
|
Well, the short answer is
form2.Show()
Me.Close() However, in reality it's not quite that simple. When you show your first form with Application.Run(New Form1()) , the lifetime of the application is tied to the lifetime of your form. There's an article[^] by Marc Clifton on this site that explains how to switch top-level forms using a custom application context.
Another approach is to start the application with an object that knows how to launch and close the forms in your application. To start with, it would show the initial "view" of your application (Form1) and, upon request, switch to a different "view", which could be closing form1 and opening form2 or opening forms 2 or three and closing form1 conditionally or whatever.
The second approach is infinitely more flexible, but it also requires more work to implement.
Charlie
if(!curlies){ return; }
|
|
|
|
|
in the Form1 , write this, attached to the Command1 button :
Sub Command1_Click()
Form2.Show
End Sub
in the Form2, write this :
Private Sub Form_Load()
Unload Form1
End Sub
aprx
|
|
|
|
|
Hi.
Is it possible to convert a bitmap held in memory to jpg, also held in memory?
|
|
|
|
|
Hi,
I assume ur bitmap is in form of array of bytes in that case u can convert it to jpg using...............
Dim wstWriter1 As New FileStream("c:\abc.jpg", FileMode.Create)
Dim bwWriter As New BinaryWriter(wstWriter1)
bwWriter.Write(pi_arrbyteFiles)
bw.close()
wstWriter1.close()
I hope this is what u want......................:->
regards,
Ritesh
|
|
|
|
|
Well not exactly….
I have bitmap in memory (byte array)
Now… I want to convert the bytes (the bitmap) to a jpg picture, without saving it to disk first.
Like using a codec
|
|
|
|
|
Hi (sorry for my english) - VB6 and W2K
I need a script for download CGI generated page to file. Actually using script from http://www.devx.com/vb2themax/Tip/19203 , but its unstable (returning err "-2147220504" and description "An error occurred calling InternetOpenUrl function"). Please recommend me a solution of this error or better script.
THX
|
|
|
|