|
hi my task is develop wordart which we can able to sizing and shaping according to mouse moving
|
|
|
|
|
Word art is where the font is all different shapes, right ? You can render a character into a path, which you can then warp.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am trying to get several forms to work together. I have all my forms added and as long as only my first form has references to other forms I don't get an error, but as soon as I make other forms reference each other, i get an error and it wont run at all. Here is the coding I have so far for the forms. (each form as a single project runs fine)
(game.vb)(also listed as my start object in my project properties)
Module game
Sub Main()
Dim form1 As New form1
Dim code As New code
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
form1.ShowDialog()
code.ShowDialog()
decode.ShowDialog()
math.ShowDialog()
piglatin.ShowDialog()
End Sub
End Module
(form1)(this is my starting form and does work as long as other forms dont have any form references)
Dim code As New code
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
code.Close()
decode.Close()
math.Close()
piglatin.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If optCode.Checked = True Then
Me.Visible = False
code.Visible = True
decode.Visible = False
math.Visible = False
piglatin.Visible = False
ElseIf optDecode.Checked = True Then
Me.Visible = False
code.Visible = False
decode.Visible = True
math.Visible = False
piglatin.Visible = False
ElseIf optMath.Visible = True Then
Me.Visible = False
code.Visible = False
decode.Visible = False
math.Visible = True
piglatin.Visible = False
ElseIf optPiglatin.Visible = True Then
Me.Visible = False
code.Visible = False
decode.Visible = False
math.Visible = False
piglatin.Visible = True
End If
End Sub
End Class
(code)(this is the second form in my list, moment i had references to the first form, it all stops working)
(global varables)
Dim form1 As New form1
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
(this is my exit button)
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
form1.Close()
decode.Close()
math.Close()
piglatin.Close()
End Sub
(this is my back button which should return to the menu(form1))
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.Visible = False
form1.Visible = True
End Sub
This is all the code that I have that concerns any joining of forms. I seriously don't know what I am doing wrong on this.
oh, the error I am getting when I have the code uncommented on my form-code is:
An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll (this is on the messagebox that pops up.)
The highlighted text that appears is:
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New() (this is the highlighted line of code)
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
|
|
|
|
|
Tretanya wrote: 'System.StackOverflowException'
This means your forms are calling each other over and over, until you run out of stack space
Instead of making your classes so tightly coupled, you should use delegates to define communication between forms.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Could you give an example of what your meaning? I am not sure what you are meaning of using delegates.
Thanks for your quick reply
|
|
|
|
|
Do you know what a delegate is ? Have you tried using google to find out ?
A delegate is a variable which represents a function definition. It can be assigned to any function that fits the definition, which means that one form can define a method used to pass data as a delegate, and an instance of that delegate, and another form can define the function that the instance is assigned to. So, form1 can call a method which is within form2, and pass any data it likes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi,
anyone know how to search the date by "dd/mm/yyyy" in sql query!
my code is :
Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "#
and data type i set it to date/time!
The result is not efficient to select the month!
Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006......
Please help!
|
|
|
|
|
I thnk DATEPART is what you need, perhaps.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Most likely due to the date format that you are using. The database is probably expecting the format "MM/dd/yyyy".
You should use an unambigous date format like ISO 8601 ("yyyy-MM-dd"), or better yet, parameterised queries.
---
b { font-weight: normal; }
|
|
|
|
|
use "yyyy-MM-dd" + " 00:00:00 Between "yyyy-MM-dd" + " 23:59:59 "
Format
Ravikumar
[Coimbatore]
|
|
|
|
|
This is a piece of code you can use to convert data:
SET DATEFORMAT dmy
DECLARE @datevar datetime
SET @datevar = '31/12/1998'
SELECT @datevar
And the result are:
1998-12-31 00:00:00.000
Hope this helps!
-- modified at 9:07 Wednesday 6th December, 2006
|
|
|
|
|
good day everyone, once again i need your help...("i do always need your help...")
how to clear textbox control?
i only do this manually like this : textbox1.text = ""
my problem is, if i will have 10 more textbox in my form it will consume more time to do the same thing...
anyone can help me, how to solve my problem of difficulties?....
i know its to simple for you guys... pls i need your help once again... thank you...
Special Thanks to Sir Chris.. for giving your ideas...
nothing is impossible.....
|
|
|
|
|
momooomooomomo wrote: my problem is, if i will have 10 more textbox in my form it will consume more time to do the same thing...
It doesn't take that long, just change the TextBox value.
|
|
|
|
|
thats good and i appreciat your effort... but my problem is how to code on how to clear textbox without knowing that you have 10 or more textbox in a form?... that idea is great but i need more technical answer coz i already done this one textbox1.text = ""...
nothing is impossible.....
|
|
|
|
|
The only other thing I can think of is setting a Property Binding to each textbox and changing the property binding. That may not be how you want to do it, but I'm not sure how else too.
Is the user going to be adding more textboxes to your form?
|
|
|
|
|
hi,
this code snippet will clear all textboxes present on the windows form
Dim ctrl As New Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is System.Windows.Forms.TextBox Then
ctrl.Text = ""
End If
Next
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
I need my program to go intop a datatable and grab 2 values and assign them to 2 different variables. BUT i need the program to grab the 2 cell values base upon another cell value. so, Basically i need to search the database and pull the row of data related to the criteria that i enter for column 1, and assign col2 and col3 to seperate varibles.
Thanx for the ear
Joshua
|
|
|
|
|
Yes when I my form layed out with all my buttons, text, comboboxes, etc... and use the Fontdialog to change the type, style and size it always makes the controls overlap others. I have looked for a way to make the form, controls, etc... to resize to handle the larger font size and or style to keep the same look, but I can't. Does anyone have a way to fix this?
|
|
|
|
|
I'm trying to get a VB report to read its data from a dataset but when the report prints it is blank.
First I created a dataset in the project. I right clicked on the dataset designer and created a table with one column in it. Then I created a VB report and dragged the column from the datasources window onto the report. Next I created a form and dropped a reportviewer onto it and attached the report to reportviewer. In the load of this form I put the following code in to populate the dataset.
Me.SalesOrderDataSet = New Inventory.SalesOrderDataSet
Me.SalesOrderDataSet.DataSetName = "SalesOrderDataSet"
Me.SalesOrderDataSet.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema
Dim newrow0 As DataRow
newrow0 = SalesOrderDataSet.SalesOrder.NewRow
newrow0.Item("company") = "Arlington"
SalesOrderDataSet.SalesOrder.Rows.Add(newrow0)
This code is supposed to populate the dataset for the report but why is the report not displaying this data?
|
|
|
|
|
:-DI am 6years-VB6 programmer.
I newly stepped into vb.net
I want to set up dataset with a datagrid
Although I used different ways I couldn't succeeded.
I just want a small, simple database connection on a Form.
Thanx
gorenekli
|
|
|
|
|
Hi, this is an excerpt from one of my recent projects
<br />
Dim connection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))<br />
Dim command As New SqlCommand("Select * from course inner join Faculty on course.CMgr = faculty.staffID", connection)<br />
Dim dataAdapter As New SqlDataAdapter(command)<br />
Dim result As New DataSet<br />
connection.Open()<br />
dataAdapter.Fill(result, "Course")<br />
connection.Close()<br />
addCourseGrid.DataSource = result<br />
addCourseGrid.DataBind()
I hope it helps!
|
|
|
|
|
I wrote a small SQL wraper here:
http://www.codeproject.com/useritems/winSQLite.asp[^]
it makes life easyer...it was writen for 2005, but I think the only thing that needs to be changed to work with 2003 would be a small part in the conversion of a datareader to a dataset.
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Hi all,
I have recently been trying to find the best method of determining how many lines a text file contains. The main issue has been that the files I am working with are usually above 100Mb and are located on network shares of varying connected speeds and reliability.
Just thought I would share my experiences and see if anyone else had any ideas or recomendations
So far I have tried the following:
1) Looping through the file using the IO.TextReader (both readline, and readtoend methods) but this uses a whole heap of memmory and is very very slow. It is also hard to implement a progress indicater.
<br />
Private Function LineCount(FileName) As Long<br />
Dim TX As IO.TextReader = IO.File.OpenText(FileName)<br />
<br />
Dim ALine As String = TX.ReadLine<br />
Dim Counter As Long = 0<br />
<br />
Do While Not ALine Is Nothing<br />
Counter += 1<br />
ALine = TX.ReadLine<br />
Loop<br />
<br />
TX.Close()<br />
<br />
Return Counter<br />
<br />
End Function<br />
2) Looping through the file using the IO.FileStream byte at a time. This seems to perform better than the textreader method but is still a very slow option. It however does provide an easy way to show the progress by calculating the bytes done against the total file size
<br />
Public Function LineCount(ByVal fileName As String) As Long<br />
<br />
Dim lineBuffer As Byte()<br />
lineBuffer = New Byte(4196 - 1) {}<br />
Dim LineCount As Long<br />
Dim FI As New IO.FileInfo(fileName)<br />
Dim FileSize As Long = FI.Length<br />
Dim BytesProcessed As Long = 0<br />
Dim BufferRead As Integer = 0<br />
Dim x As Integer = 0<br />
LineCount = 0<br />
<br />
<br />
Dim FS As New FileStream(fi.FullName, FileMode.Open, FileAccess.Read, _<br />
FileShare.Read, lineBuffer.Length)<br />
<br />
Do While BytesProcessed < FileSize<br />
Try<br />
BufferRead = FS.Read(lineBuffer, 0, lineBuffer.Length)<br />
<br />
If BufferRead > 0 Then<br />
For x = 0 To (BufferRead - 1)<br />
If lineBuffer(x) = 13 Then<br />
LineCount += 1<br />
End If<br />
<br />
' Evaluate Percent done here i.e Percentdone = CInt((BytesProcessed / FileSize) * 100)<br />
<br />
BytesProcessed += 1<br />
Next<br />
End If<br />
Loop<br />
<br />
FS.Close()<br />
Return LineCount<br />
<br />
End Function<br />
3) looping through a percentage of the file using the IO.FileStream byte at a time and estimating the number of lines based on the overall file length and the average line byte length. This was fairly fast but produced varying degrees of accuracy as the line lengths are mor often than not irregular.
<br />
Public Function LineCount(ByVal fileName As String, ByVal PercentageRead as Integer) As Long<br />
<br />
Dim lineBuffer As Byte()<br />
lineBuffer = New Byte(4196 - 1) {}<br />
Dim LineCount As Long<br />
Dim FI As New IO.FileInfo(fileName)<br />
Dim FileSize As Long = FI.Length<br />
Dim BytesProcessed As Long = 0<br />
Dim BufferRead As Integer = 0<br />
Dim x As Integer = 0<br />
Dim FileSizePercentage As Integer = Cint((FileSize / 100) * PercentageRead)<br />
LineCount = 0<br />
<br />
<br />
Dim FS As New FileStream(fi.FullName, FileMode.Open, FileAccess.Read, _<br />
FileShare.Read, lineBuffer.Length)<br />
<br />
Do While BytesProcessed < FileSizePercentage<br />
Try<br />
BufferRead = FS.Read(lineBuffer, 0, lineBuffer.Length)<br />
<br />
If BufferRead > 0 Then<br />
For x = 0 To (BufferRead - 1)<br />
If lineBuffer(x) = 13 Then<br />
LineCount += 1<br />
End If<br />
<br />
' Evaluate Percent done here i.e Percentdone = CInt((BytesProcessed / FileSizePercentage) * 100)<br />
<br />
BytesProcessed += 1<br />
Next<br />
End If<br />
Loop<br />
<br />
FS.Close()<br />
<br />
Return Clng((LineCount / FileSizePercentage) * 100)<br />
<br />
End Function<br />
4) Using LogParser Interfaces collection shipped with MS Logparser 2.2. This seems
to be the fastest method but will only work for files with a line count within the Int32 range. And again has no way to determine the percentage done.
<br />
Public Function LineCount(ByVal fileName As String) As Integer<br />
<br />
Dim InputClass As New MSUtil.COMTextLineInputContextClass<br />
Dim LogParserClass As New MSUtil.LogQueryClass<br />
Dim IRs As MSUtil.ILogRecordset <br />
Dim QueryString As String = "SELECT COUNT(Text) FROM '" & fileName & "'"<br />
<br />
InputClass.splitLongLines = False <br />
<br />
IRs = LogParserClass.Execute(QueryString, InputClass)<br />
Return IRs.inputUnitsProcessed<br />
<br />
End Function<br />
Ideas and thoughts appreciated
|
|
|
|
|
I'm not completely sure but I was under in the impression that when using IO.TextReader and IO.FileStream Classes is like opening a connection to the document and reading it from it original location. Would creating a temp copy of the file for processing help your performance?
milkyjoe wrote: above 100Mb and are located on network shares of varying connected speeds and reliability
Dim dtTimeStamp As String = Date.Now.ToString.Replace("/", "-")<br />
Dim tempFileDir As String = IO.Directory.GetCurrentDirectory & "\temp"<br />
Dim tempPath As String = tempFileDir & "\" & dtTimeStamp.Replace(":", "")<br />
IO.File.Copy(remoteFileLocation, tempPath)
Do all the processing then kill the file when your collecting or garbage.
|
|
|
|
|
Hi AreJay, thanks for the reply.
I had thought about trying this but have not as yet. If I remember correctly there is also a bytestream method for copying files. I am now wondering if I can read the file as I copy it. I will give it a go and let you know how I get on.
|
|
|
|