|
thnx for the advice man
i have sought before & i knew something called User controls i tried with them but actualy i didn't understand
i know this is stupide but can you help ?? do you have any good sourses something like that ??
try to be good if you can't be the best
|
|
|
|
|
My best source is Google. I taught myself everything I know about custom controls by trial and error and Google. There is no one site that has everything you need to know, not even the basics, on how to create your own custom control.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wrote a small app in Visual Studio 2003 for a pocket pc which works well in the emulator but comes up with the following error when running on the device itself:
SmartDeviceApplication1.exe
TypeLoadException
Could not load type
System.Data.SqlServerCe.SqlCeRemote
DataAccess from assembly
System.DataSqlServerCe,
Version=1.0.5000.0
What do I need to do to correct the problem.
Thanks for any help!
|
|
|
|
|
Is there a way to override the code that vb.net generates for Deletes, Updates and Inserts?
The code generated is slowing down my app for these functions, especially for only 1 record.
I'm using the BindingNavigator controls to add, update, delete, etc.
PPOBindingSource.EndEdit()
PPOTableAdapter.Update(Me.DwCustomDataSetPPO.BenefitAdj_PPO)
Is there someway to over ride what Vb generated and create my own code for these functions?
The generated code is inefficient and convoluted.
Any help greatly appreciated.
Mike
|
|
|
|
|
I am trying to create a setup project that will upgrade certain .dlls that are only used by my project. The idea behind this is that only the required dlls need replacing as opposed to the whole application being re-installed.
The setup project I have created at present will not overwrite the dll but will install the updated one if I previously remove the old one manually.
I am not sure if this is the way to do it and would appreciate any help/advice on this matter
J
|
|
|
|
|
Hello,
I have a MDI-application in VB.NET. Now I want to show a dialogbox in it, but while the dialogbox is showing, it should not be possible to click on the other forms (eg. close parent-form of my MDI-application).
Can anyone tell me how to do this?
Thanks!
G72360
|
|
|
|
|
Call <a href="http://msdn2.microsoft.com/en-us/library/c7ykbedk(VS.80).aspx" rel="nofollow">ShowDialog</a>[<a href="http://msdn2.microsoft.com/en-us/library/c7ykbedk(VS.80).aspx" target="_blank" rel="nofollow" title="New Window">^</a>] on the new form instead of Show .
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
------------Begin Update on my original question
I have been able to successfully store the attribute list in the TreeNode.Tag field in the AddNode function.
I have changed the line of code in AddNode function
inTreeNode.Text = inTreeNode.Text & " " & (attrNode.OuterXml).Trim
TO
inTreeNode.Tag = inTreeNode.Tag & " " & (attrNode.OuterXml).Trim
I do not see the Tag field displayed on the treeview though.
Then I changed the line of code in SaveScreenChangesToFile function
Else
StreamWriterForXml.Write("<" & currentTreeNode.Text & ">")
TO
Else
StreamWriterForXml.Write("<" & currentTreeNode.Text & " " & currentTreeNode.Tag & ">")
-- now I can save the attributes to an output.
But part of my original questions remains... how to display attributes in treeview? Do I HAVE TO populate the TreeNode.text field with attributes to see it? Which will have the effect of complicating my function when I go to write it out as a file. I will have to parse the TreeNode.text field more carefully.
-----------End Update on my original question
Hello,
I am having success with the following code in parsing element's attributes and displaying them in a treeview in visual studio 2003 in a vb.net application. However, when I go to save the treeview using the following code, I do not get any attributes. I am wondering if the way I am storing the attributes in the treeview is the problem. It seems you can display attributes in a treeview but they are still considered elements in a treeview structure. Below is the code I am using. By the way, when I only display elements in the treeview using the code below, there is no problem displaying or saving elements. It is only when I try to add the ability to display and save attributes that my trouble begins because I miss creating ending tags in the saved output and it just gets totally wierd for other things. I am sorry I am not explaining all the output problems when I try to deal with attributes. If anyone is able to shed some light, I will be glad to bore you with the details.
thanks.
tanya
BEGIN code that parses xmldocument into treeview
----- begin button subroutine that fires off reading xml from
------sql server and dumping it into a datatable, then read
------ datatable into an xmldocument
Private Sub ButtonUseThisQuotNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUseThisQuotNumber.Click
PopulateDataSetWithXml(ComboBoxHelper.Text)
ButtonUseThisQuotNumber.Visible = False
DisplayXmlInTreeView()
TreeViewForXml.Visible = True
End Sub
----------BEGIN SUBSET of PopulateDataSetWithXml procedure used
Try
SQLCommandForQuery = "Select XMLData from webuser.WEB_ORDER_XML where Quote_Num = '" & nQuoteNum & "'"
Dim SqlDataAdapterForPopulateDataTable As New SqlDataAdapter(SQLCommandForQuery, DummyString)
SqlDataAdapterForPopulateDataTable.Fill(DataSetOfData, "TableOfData")
SqlDataAdapterForPopulateDataTable.Dispose()
Dim RowOfData As DataRow = DataSetOfData.Tables(0).Rows(0)
' just for fun I found out it is 42,000+ characters
i = RowOfData(0).ToString.Length
Dim XmlDoc As New Xml.XmlDocument
XmlDoc.LoadXml(RowOfData(0).ToString)
Dim AnXmlNode As XmlNode
AnXmlNode = XmlDoc.DocumentElement
Catch ee As Exception
MsgBox(ee.ToString)
End Try
----------END SUBSET of PopulateDataSetWithXml procedure used
Public Sub DisplayXmlInTreeView()
Dim showAttributes As DialogResult
Try
' SECTION 1. Create a DOM Document and load the XML data into it.
Dim RowOfDataForTreeView As DataRow = DataSetOfData.Tables(0).Rows(0)
domForTreeView.LoadXml(RowOfDataForTreeView(0).ToString)
showAttributes = MessageBox.Show("Do you want attributes displayed?", _
"Attributes in Treeview", MessageBoxButtons.YesNo)
If showAttributes = DialogResult.Yes Then
displayAttributesFlag = True
Else
displayAttributesFlag = False
End If
' SECTION 2. Initialize the treeview control.
TreeViewForXml.Nodes.Clear()
TreeViewForXml.Nodes.Add(New TreeNode(domForTreeView.DocumentElement.Name))
Dim tNode As New TreeNode
tNode = TreeViewForXml.Nodes(0)
' SECTION 3. Populate the TreeView with the DOM nodes.
AddNode(domForTreeView.DocumentElement, tNode)
TreeViewForXml.ExpandAll()
Catch xmlEx As XmlException
MessageBox.Show(xmlEx.Message)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub AddNode(ByRef inXmlNode As XmlNode, ByRef inTreeNode As TreeNode)
Dim xNode, attrNode As XmlNode
Dim tNode As TreeNode
Dim nodeList As XmlNodeList
Dim i, j As Integer
Dim dumb As String
'Dim attributes As XmlAttributeCollection
' Loop through the XML nodes until the leaf is reached.
' Add the nodes to the TreeView during the looping process.
If inXmlNode.HasChildNodes() Then
nodeList = inXmlNode.ChildNodes
If (displayAttributesFlag = True) Then
If inXmlNode.NodeType = XmlNodeType.Element Then
If inXmlNode.Attributes.Count > 0 Then
' attributes = inXmlNode.Attributes
'dumb = attributes.Item(0).OuterXml
For j = 0 To inXmlNode.Attributes.Count - 1
attrNode = inXmlNode.Attributes(j)
inTreeNode.Text = inTreeNode.Text & " " & (attrNode.OuterXml).Trim
Next
End If
End If
End If
For i = 0 To nodeList.Count - 1
xNode = inXmlNode.ChildNodes(i)
inTreeNode.Nodes.Add(New TreeNode(xNode.Name))
tNode = inTreeNode.Nodes(i)
AddNode(xNode, tNode)
Next
Else
' Here you need to pull the data from the XmlNode based on the
' type of node, whether attribute values are required, and so forth.
inTreeNode.Text = (inXmlNode.OuterXml).Trim
End If
End Sub
END code that parses xmldocument into treeview
---------BEGIN code that reads the treeview into a file
Private Sub ButtonSaveScreenChangesToFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveScreenChangesToFile.Click
Dim parentNode As TreeNode
Dim testString As String
Dim xxx As Integer
'get the parent node
parentNode = TreeViewForXml.Nodes(0)
xxx = parentNode.GetNodeCount(True)
MsgBox(parentNode.Text & " has " & xxx & " nodes")
StreamWriterForXml = New StreamWriter("c:\xmlTestOutput.xml")
StreamWriterForXml.Write("<" & parentNode.Text & ">")
SaveScreenChangesToFile(parentNode)
StreamWriterForXml.Close()
MsgBox("Saved output to c:\xmlTestOutput.xml")
End Sub
Private Sub SaveScreenChangesToFile(ByVal nodePassedIn As TreeNode)
Dim tNode As TreeNode
Dim ie As IEnumerator
Dim nodeLabel As String
ie = nodePassedIn.Nodes.GetEnumerator()
nodeLabel = nodePassedIn.Text
While ie.MoveNext()
Dim currentTreeNode As TreeNode
currentTreeNode = ie.Current
If currentTreeNode.GetNodeCount(True) = 0 Then
'this node has no children to parse
StreamWriterForXml.Write(currentTreeNode.Text)
StreamWriterForXml.WriteLine("")
Else
StreamWriterForXml.Write("<" & currentTreeNode.Text & ">")
End If
If currentTreeNode.GetNodeCount(True) > 0 Then
'this node has children to parse, recursively call this program
SaveScreenChangesToFile(currentTreeNode)
End If
End While
StreamWriterForXml.Write("")
StreamWriterForXml.WriteLine("")
End Sub
----------END code that reads the treeview into a file
-- modified at 10:32 Monday 24th April, 2006
|
|
|
|
|
hi
i'm making a simple program in which i have textbox and a button.
what i want is that when i click on the button its shows me a text of textbox in a message box.
i have initialized a textbox in pageload.....
code is:-
for button
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(TextBox1.Text)
End Sub
in page load
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Text = "Amit"
end sub
when i run this it always shows me the "Amit".
however i change the value of textbox it show me "Amit".
plz tell me where i'm wrong.
|
|
|
|
|
Looks like your Page_Load() event is being fired every time. Check your other code to see what's happening.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
thanx
i haven't use ispostback false that is why i was getting th same value.
byeeeee
|
|
|
|
|
ASP.NET questions, which is what you're using, regardless of the language your writing your code in belong in the ASP.NET Forum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi ,
if it is vb.net just try to change MsgBox with Messagebox.show(textbox1.text,"title",.....)
i think it will work
try to be good if you can't be the best
|
|
|
|
|
i have created a graph using Business Intelligence on Visual Studio 2005 and need to call that graph on an application that already exists, i've tried using the url of where the graph sits as a hyperlink but that seems not to work. please help.
|
|
|
|
|
So... what is the error message you get - or describe the unwanted behaviour of the program so we have at least some ide where to start to help you. An example of the code you are using would also help (but don't paste the entire program ).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
hi there
how to create the folder dynamically in vb.net through the code, without opening the folderbrowser ?
bharath.s
|
|
|
|
|
System.IO.Directory.CreateDirectory(fullPathToCreate)
|
|
|
|
|
|
I have found an article about how to print listview in C#.NET and I converted the class, however, the class will not work.I hope someone will help me out! Thanks. Any way will be ok as long as I can print it out.
|
|
|
|
|
You need to provide:
(1) The link to the original code
(2) Some detail of what error you are getting
(3) The code after your conversion to Vb.net
Otherwise nobody can help you.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Protected Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim linesPerPage As Single = 0
Dim yPosition As Single = 0
Dim count As Integer = 0
Dim leftMargin As Single = ev.MarginBounds.Left
Dim topMargin As Single = ev.MarginBounds.Top
Dim line As String = Nothing
Dim printFont As Font = Me.ListView1.Font
Dim myBrush As New SolidBrush(Color.Black)
' Work out the number of lines per page, using the MarginBounds.
linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)
' Iterate over the string using the StringReader, printing each line.
line = myReader.ReadLine()
While count < linesPerPage And (Nothing <> line)
' calculate the next line position based on
' the height of the font according to the printing device
yPosition = (topMargin + (count * printFont.GetHeight(ev.Graphics)))
' draw the next line in the rich edit control
ev.Graphics.DrawString(line, printFont, myBrush, leftMargin, yPosition, New StringFormat())
count += 1
line = myReader.ReadLine()
End While
' If there are more lines, print another page.
If Not (line Is Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
myBrush.Dispose()
End Sub 'ThePrintDocument_PrintPage
Private Sub PrintPreviewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewToolStripMenuItem.Click
Try
Dim strText As String = Me.ListView1.Text
myReader = New StringReader(strText)
Dim printPreviewDialog1 As New PrintPreviewDialog()
printPreviewDialog1.Document = Me.PrintDocument1
printPreviewDialog1.FormBorderStyle = FormBorderStyle.Fixed3D
printPreviewDialog1.ShowDialog()
Catch exp As Exception
System.Console.WriteLine(exp.Message.ToString())
End Try
End Sub
Please try to modify this because we have the same problem.this can print and preview in richtextbox only
|
|
|
|
|
Hi,
How can we connect as400 database to vb6.0 ?
KhanR
|
|
|
|
|
Use ODBC to connect. Here's a Google search[^] to get you started.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
How can i on a Form open like a browser (Explorer or so) and choose an image and save it on a form??. Like an employee photo on an employee_record.
cld
|
|
|
|
|
You're question is worded that clearly, but I think you're looking for the openFileDialog[^].
Other than that, I have no idea what you mean by "store an image on a form".
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 12:24 Monday 24th April, 2006
|
|
|
|