|
MoonSong wrote:
Maybe I better just shelve this ambition until I get to college in a few years. By then, VB.NET will be officially dead.
Not likely...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I always found it best to use an Image Box For resizing images as it provides more clarity. If you want a sample project sent to you, email me.
Cheers
"If i was king cigarettes would be free."
|
|
|
|
|
hi,
we r using vb.net for creating a web service. we r refering to the book vb.net in 21 days. it says that when we select an ASP.NET web service application, a vsdisco file should be created automatically. this not
happen in our case. what r the other ways to find this disco file?
|
|
|
|
|
In VB, How do I check whether the string entered in the text box is a valid string & does not contain a numeric value?
|
|
|
|
|
Depends on how you define 'a valid string'.
This function returns false if one of the chars in the string is a number.
<br />
Private Function IsValid(ByVal myString As String) As Boolean<br />
Dim c As Char<br />
For Each c In myString<br />
If Char.IsNumber(c) Then<br />
Return False<br />
End If<br />
Next<br />
Return True<br />
End Function<br />
Instead Char.IsNumber(c) you can take several other static functions of Char to get your needed functionality.
|
|
|
|
|
I have a basic program that uses the "StreamReader" class to open a text file and read it line by line. Now I don’t know how to Search the lines in the text file for a value (string). Basically I’d like to examine the line of text for the existence of a string and then perform an action (for my prototype my action is a simple MessageBox).
Is there a class or function out there that can perform this? I looked up "IndexOf" in the MS help file and the example doesn't seem to be working for me. This is what I have so far.... Thanx in advance for any guidance towards the right direction.. I've imported System and System.IO already.
Dim TestFile As StreamReader
Dim LineofText As String
Dim Regval As String
TestFile = File.OpenText("C:\Test code\testing.txt")
Do Until TestFile.Peek = -1
LineofText = TestFile.ReadLine()
Regval = LineofText.IndexOf("badvalue")
If Regval = "badvalue" Then
MessageBox.Show("The value has been found")
Else
MessageBox.Show("its not on this line")
End If
Loop
TestFile.Close()
Update:
Never mind I found what was wrong .. I was expecting the "IndexOf()" to return the "String" that i was searching for but it was returning a 0/-1 (true or false)... I can deal with that
If there is a better method please let me know!!
-Mark-
|
|
|
|
|
badcredit wrote:
I was expecting the "IndexOf()" to return the "String" that i was searching for but it was returning a 0/-1 (true or false).
That still isn't quite the explanation. The -1 means that it didn't find your string, the 0 indicated that it did find your string at position zero (the first character) of the line.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hello All,
In DataSet, How Many records we can store Maximum
rugfy
|
|
|
|
|
In theory, there isn't a limit, except for available memory. In practice, it's whatever you think is acceptable performance. If performance gets too bad, then you'll need to rewrite your data handling code to support paging.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello All,
Help me in editing wave ie cut,copy a part of wave from one audio wave file into another or new wave file.If u
find any dll or source code is available in any site Please
tell me.Thanks in adv.
|
|
|
|
|
In .Net When you Load the Recordset to datatable.If you set source of data to controls like listbox or combobox some times the datas are not viewed instead of In control we see the form of System.Data.DataRowView(It happenes only in sometime not all time )but we can avoid it through dataview
For example
dim dt as datatable
Adapter.Fill(dt)
ComboBox.Datasource = dt
ComboBox.DisplayMember="Column1"
ComboBox.ValueMember = "Column2" // In my case Display member displays record well but problem in Valuemember only i got as system.Data.DataRowView
you can avoid this in DirectCasting of DatarowView
Otherwise
dim dv as dataview = dt.DefaultView
ComboBox.Datasource = dv
ComboBox.DisplayMember="Column1"
ComboBox.ValueMember = "Column2" // Now works fine
Otherwise you can directly give as
ComboBox.Datasource = dt.Defaultview
ComboBox.DisplayMember="Column1"
ComboBox.ValueMember = "Column2" // Now works fine
I dont know why its happened,If anybody knows ,Let inform here
Rugfy
Rugfy
|
|
|
|
|
Hi,
Check whether ur Column name "Column2" is exactly same as that ur fetching from Databse(I mean check for case sensitivity)
Regards,
Ritesh
|
|
|
|
|
Hai,
No ritesh,I have checked thats not the problem,I have given details follws
Desc Of my Table in DataBase
Name Null? Type
----------------------------------------- -------- -------------
OWNERSHIPTYPEID NOT NULL NUMBER
DESCRIPTION NOT NULL VARCHAR2(50)
MySql Satament
cmdLocal = New OracleClient.OracleCommand("SELECT OWNERSHIPTYPEID,DESCRIPTION FROM OWNERSHIPTYPE", Me.conLocal)
My Property Binding Of Control
Me.DataSource = dtLocal //DataTable
Me.DisplayMember = "DESCRIPTION"
Me.ValueMember = "OWNERSHIPTYPEID"
This code has given problem,But in another cmbobox like this for another table works fine
Rugfy
|
|
|
|
|
Is it possible to get the file name from binary data in the blob field( say in oracle) using VB or other programming language? I am new to this blob thing. I just want to clear this out.
|
|
|
|
|
Hi...
MS Access has a menu option for Text Box Controls called "Conditional Formatting". It is a great tool that I commonly use to assist the user to identify where on the form he/she is. Example, when Text Box 1 'has focus' instead of the background color being green, it is red. The forecolor is also changed.
Does VB.net offer a similar feature? If so, I have yet to find it. Of course, I could instruct screen color changes based on the 'Enter' and 'Leave' events for each control, but this would be terribly inefficient.
Any suggestions for a better way to do this using a more efficient code procedure.
Thanks
Pat
|
|
|
|
|
in the sql the orderDate DataType is smalldatetime
I want to bind this orderDate to OleDbDateReader, but it doesn't work, is there anyone know why?
here is my coding:
dim OrderDate as Date
connecting to sql...
query: Select date_order from order
DataReader = DataSet.ExecuteReader()
Do While DataReader.Read()
OrderDate = DataSet.GetDataTime(0)
loop
txtOrderDate = OrderDate
Lisa
|
|
|
|
|
first think u seen ur code,
datset doesnot have executereader ,how u exeute the reader from dataset,use the OledbCommandObjecty for execute reader obviously u can get result
rugfy
|
|
|
|
|
Hi,
We haves some problems with the FormBase.
This Form use backGroundImage(.jpg), I resize and repaint the image but flickering is always there.
Private Sub FormBase_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
If Not Me.BackgroundImage Is Nothing Then
e.Graphics.DrawImage(Me.BackgroundImage, 0, 0, Me.Width, Me.Height)
End If
End Sub
Private Sub FormBase_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Not Me.BackgroundImage Is Nothing Then
Me.CreateGraphics().DrawImage(Me.BackgroundImage, 0, 0, Me.Width, Me.Height)
End If
End Sub
And in my Constructor :
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.DoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint, _
True)
Thanks a lot for answers
|
|
|
|
|
First of all when you draw the image yourself you shouldnt assign the BackgroundImage property. Instead leave it nothing and store the image in some private variable of your own.
Also you shouldnt have the same code in your Paint and Resize event. Instead of drawing the image in the Resize event I would try to call Me.Invalidate(). This will cause repainting of the form.
Havent tried this, but I think it should work.
|
|
|
|
|
Ok thank you Invalidate work but this is very slow. My Paint methode looks like :
e.Graphics.DrawImage(Me.BackgroundImage, 0, 0, Me.Width, Me.Height)
I think that the method "DrawImage" is very slow ...
how can i improve that?
Thanks again!
Dany
|
|
|
|
|
To say it again:
Dont use the BackgroundImage property when you are drawing the image youserlf. If you do this the form will paint the background (beacuse of the property) and after it you draw it int the paint event handler. This should make it a bit faster.
But I dont know of any faster method (then DrawImage) to paint a bitmap on a form.
|
|
|
|
|
hi can any one suggest me what should i do to make application works fine with any resulion
|
|
|
|
|
Design the GUI at the lowest screen resolution you anticipate the app will be used at and you will have no problems at higher resolutions.
|
|
|
|
|
but right now i m working in 800 by 600 pixels and when i run the app dev for this resolution at 1024 by 768 pixels then there r so many blank spaces on the form coz controls size is very small at 800 by 600 so in 1024 by 768 mode its locks so many blank spaces on forms
|
|
|
|
|
Have you tried doing
Me.Scale = 1
By doing this all items on the form will remain the same size with respect to your form. Also the form will be in the same proportions with respect to any resolution.
|
|
|
|