|
If you want to develop the control in VB.Net, let try this book.[^] But if you want to develop ASP.Net control, try to use this book.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi all,
The follwoing code is used to display the statistics of the given '.NET Solution' File.
1. Form Name
2. Controls from Each Form, Etc.,
Design
------
1. Add RichTextBox , 2 Labels, Button, OpenFile, DataGrid class on Form.
Code
----
Imports System.Data.SqlClient
Private Dset As DataSet
Dim _Starts As Integer, _Path As String
Private Sub Button1_Click(...) Handles Button1.Click
Dset = New DataSet()
With OpenFile1
.InitialDirectory = "C:\"
.Filter = ".NET Solution(*.vbproj)|*.vbproj"
If .ShowDialog = DialogResult.OK Then
If Not .FileName.Length > 0 Then
MsgBox("Please Select File Name...!", MsgBoxStyle.Critical, "Warning")
Application.ExitThread()
Else
Label1.Text = .FileName
_Starts = Label1.Text.LastIndexOf("\")
_Path = Label1.Text.Substring(0, _Starts) & "\"
FileCopy(Label1.Text, Label1.Text & ".xml")
RichTextBox1.Clear()
Dset.ReadXml(Label1.Text & ".xml", XmlReadMode.Auto)
Dim i As Integer, strForms As String
For i = 0 To Dset.Tables("File").Rows.Count - 1
If Dset.Tables("File").Rows(i)(1).ToString().ToUpper = "FORM" Then
strForms = Dset.Tables("File").Rows(i)(0)
GetControls(strForms)
End If
Next
Dset.Dispose()
End If
End If
End With
End Sub
Private Function GetControls(ByVal strFormName As String) As String
Dim _FormName As String = strFormName.Substring(0, strFormName.Length - 3) & ".resx"
Dim R As Integer, strControls As String, intDot As Integer, strCtrlName As String
FileCopy(_Path & _FormName, _Path & _FormName & ".xml")
Dim Dset1 As New DataSet()
Dset1.ReadXml(_Path & _FormName & ".xml", XmlReadMode.Auto)
For R = 0 To Dset1.Tables("Data").Rows.Count - 1
intDot = Dset1.Tables("Data").Rows(R)(0).ToString().ToUpper.IndexOf(".")
strCtrlName = Dset1.Tables("Data").Rows(R)(0).ToString().ToUpper.Substring(intDot + 1)
If strCtrlName = "MODIFIERS" Then
strControls &= Dset1.Tables("Data").Rows(R)(0).ToString().Substring(0, intDot) & Chr(13)
End If
Next
Dim strFinal As String
strFinal = strFormName & Chr(13)
strFinal &= "---------------" & Chr(13)
strFinal &= strControls & Chr(13)
RichTextBox1.Text += strFinal
End Function
Notes:
------
- Run the code and select the Button.
- Open file dialog display.
- Select the .NET Solution file name.
I hope the code will help to make documentation of .NET Solutions.
With Regards,
PANDIAN S
pandians@ho.netaccess-india.com
|
|
|
|
|
Instead of posting this in the forums, where it will disappear off the first page in a day or two, write it up in an article and post it. Hardly anyone searches the forums for stuff like this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am using below code to clear picturebox content, means drawn line but it doesn't work
Code:
Me.picboard.BackColor = System.Drawing.Color.White
Me.picboard.BackgroundImage = System.Drawing.Image.FromFile(Application.StartupPath & "\white.bmp")
If (picboard.Image Is Nothing) Then picboard.Image = New Bitmap(picboard.Width, picboard.Height)
Dim g2 As Graphics = Graphics.FromImage(picboard.Image)
g2.Clear(System.Drawing.Color.White)
Me.picboard.Show()
'g2.Dispose()
But not works
plz help me!!
|
|
|
|
|
picboard.BackgroundImage = Nothing
Regards,
PANDIAN S
|
|
|
|
|
All you need is this:
Dim g As Graphics = picboard.CreateGraphics()
g.Clear(Color.White)
g.Dispose()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No need, Please try it.
PANDIAN S
|
|
|
|
|
I have and your method doesn't work to clear the PictureBox.
Private Sub DrawPoints()
' Your method
PictureBox1.BackgroundImage = Nothing
Dim g As Graphics = PictureBox1.CreateGraphics()
' My method
'g.Clear(PictureBox1.BackColor)
g.DrawLine(Pens.Gray, CInt(PictureBox1.Width / 2), 0, CInt(PictureBox1.Width / 2), CInt(PictureBox1.Height))
g.DrawCurve(Pens.Red, Points)
g.Dispose()
End Sub
Using your method, the picture box is never cleared before the curves are redrawn. Using my method, it's cleared every time.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello'
I want to creat a way to customize the report design at run time. mean from this user can create his own report design according to organization need.
i.e there is a report to print cheque for bank system. banks have there own cheque layout.
so please guide me to creat a form to customize the report deign using VB.NET.
Thanks in advance
|
|
|
|
|
a=26
how to set b=2?
In c, you can do
b=a/10;
I try
b=CInt(a/10) in VB, and I got b=3. Thank you.
<italic>Work hard, Work effectively.
|
|
|
|
|
In C if “a “ was assigned the value of 2.6 and you executed the statement b=a/10, then b would have the value of 0.26 if it was a double and if b was an integer then it would have the value of 0.
In Visual Basic .Net we have two division operators, the / meaning floating point division and the \ meaning integer division.
Dim a As Double = 12
Dim b As Double ‘ Holds the value of integer division
Dim c As Double ‘ Holds the value of floating point division
b = a \ 5 ‘ b would have the value of 2.0
c = a / 5 ‘ c would have the value of 2.4
I hope this was of some help.
|
|
|
|
|
According to my help document IsKeyColumn is one of the columns returned when you execute a data reader for GetSchemeTable
When I execute this code:
reader = cmdSel.ExecuteReader(CommandBehavior.KeyInfo)
Dim dt As DataTable = reader.GetSchemaTable
While reader.Read()
If dt.Rows(idx).Item("IsKeyColumn") = True then
.
.
.
I get this error on the "If" line
Column 'IsKeyColumn' does not belong to table SchemaTable.
Any help??????
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
As it turns out - I dumped the schematable to see the column names
CONTRARY to my documentation, the column is named "IsKey" not "IsKeyColumn"
grrrmph....
If anyone cares, I attached code that dumps the schematable:
reader = cmdSel.ExecuteReader(CommandBehavior.KeyInfo)
Dim dt As DataTable = reader.GetSchemaTable
Dim schemaTable As DataTable
Dim myProperty As DataColumn
Dim str As String = ""
Dim myField As DataRow
schemaTable = reader.GetSchemaTable()
For Each myField In schemaTable.Rows
'For each property of the field...
For Each myProperty In schemaTable.Columns
'Display the field name and value.
str = String.Concat(str, _
String.Format("[{0}]=[{1}]{2}" _
, myProperty.ColumnName _
, myField(myProperty).ToString() _
, Microsoft.VisualBasic.ControlChars.CrLf) _
)
Next
Next
MessageBox.Show(str)
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
Does anyone know how VB translates extended keycodes (exspecialy on WinXP). When ALT+0176 is pressed, the keycode should be 0xB0 but we get 0xFFFFB0FF instead.
Signed: John R. Shaw
Blast: I must remember to find my password!
|
|
|
|
|
Hi John,
I am in no way a Hex expert, but the similarity of 0xB0 and 0xFFFFB0FF make me wonder if .NET is just specifying a longer format of the same value. dotNET also has several conversion classes that may help in the process, like converting from Hex to Decimal or bit conversions.
Probably of no help, but I hope it sparks some ideas,
Scott Page
|
|
|
|
|
Hi..Can you please tell me how can I shutdown my computer or restart it in VB.net.Please Help!!
Snaker
|
|
|
|
|
There is a function in user32.dll which is called ExitWindowsEx. The MSDN documentation for the function can be found at This Web Site. You must declear the external function, something like this
Private Declare Function MyExitWindowsEx Lib "User32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
then call the MyExitWindowsEx function with the correct parameters as per the document.
Good luck
|
|
|
|
|
That can be put to good use put a program with the close script in it at form load and put it in the startup folder.
Ouch!
1. Out of clutter, find simplicity.
2. From discord, find harmony.
3. In the middle of difficulty lies opportunity.
Albert Einstein
three rules of work
|
|
|
|
|
hello,
i am trying to parse a multiline text box, but i can't seem to figure out how to do it.
for example, if in the first text (txtInput) box i have:
hello there,
this
is
fun
i would want to print out something like:
hello there, this is fun
in the 2nd text box (txtOutput).
i thought that i could use some sort of a while statement like:
while (input.IndexOf(vbCrLf) <> -1)
where input = txtInput.text
but i'm not sure how to increment line by line. if this was a stream reader, i could do:
While (stream.Peek <> -1)
but i don't know if anything like that exists for multiline text box reading. it seems to me that the value of the textbox just becomes a string.
thanks in advance,
michael
|
|
|
|
|
hello,
i figured it out. within my while statement, i added:
input = input.Substring(input.IndexOf(vbCrLf) + 2)
in order to get to the next line. The "+ 2" confused me, as I would have thought a "+ 1 " would be sufficient. However, now I'm on the right track!
thank you,
michael
//txtIn and txtOut are my text boxes
Dim input As String = txtIn.Text
Dim currentLine As String
Dim output As String
Dim i As Integer = 1
While (input.IndexOf(vbCrLf) <> -1)
currentLine = input.Substring(0, input.IndexOf(vbCrLf))
output &= "line number: " & i & " " & currentLine & vbCrLf
input = input.Substring(input.IndexOf(vbCrLf) + 2)
i += 1
End While
txtOut.Text = output
|
|
|
|
|
Is possible to use visual basic .net to create a small file that is not required .net framework?
Lisa
|
|
|
|
|
Hi Lisa;
If your question is can you run a VB.Net program on a system that supports the
.Net Framework and have that program produce a file that can be viewed or used
on a system that does not have the .Net Framework, for example text, bmp, XML
files and others then the answer is yes. But if you are asking if you can run a
.Net program on a system that does not have the .Net Framework then the answer
is no. One of the most important part of the .Net Framework is the CLR “Common
Language Runtime”. This block of code provides the environment in which .Net
programs are executed in. You can download the .Net Framework from Microsoft
free of charge at, click here -> .Net Framework Download This download includes all that is needed to run
applications developed under .Net Framework.
I hope I have been of some help.
|
|
|
|
|
I have a borderless form with a yellow transparency key to give my form a custom shape. When i compile it on my computer it works but when i install it onto another the yellow part shows up. Any ideas????
|
|
|
|
|
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
|
|
|
|