|
ahh ic....yes that will help alot. thanks a bunch.
|
|
|
|
|
i did the code i got this error that the FileDialog did not work?
the error has this: An unhandled exception
is fileDialog a openFileDialog???
|
|
|
|
|
i figured it out.....thanks for all the help jim
|
|
|
|
|
Why not read the text file into a string using a StreamReader and display the string in a multiline textbox.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
i get wat you are saying...multilined textbox?....is that a normal text box? or is it like a textbox that can view paragraphs from a .txt file?
|
|
|
|
|
Hi,
I've been tring to get nested repeaters to work in vb.net for a while now and I can't seem to do it. The data doesnt want to bind to the second repeater, or atleast it does bind but doesnt display. Here is the code that im using:
<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Data" %>
sub Page_Load
Dim sConnString As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection As New OdbcConnection(sConnString)
Dim myInsertQuery As String = "SELECT * FROM questions"
Dim myOdbcCommand As New OdbcCommand(myInsertQuery)
myOdbcCommand.Connection = oODBCConnection
oODBCConnection.Open()
questions.DataSource= myOdbcCommand.ExecuteReader()
questions.DataBind()
myOdbcCommand.Connection.Close()
oODBCConnection.Close()
end sub
sub questions_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles questions.ItemDataBound
if e.item.itemtype = ListItemType.Item or e.item.ItemType = ListItemType.AlternatingItem then
Dim sConnString2 As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection2 As New OdbcConnection(sConnString2)
Dim SQLstring2 As String = "Select * from options"
Dim myOdbcCommand2 As New OdbcCommand(SQLstring2)
myOdbcCommand2.Connection = oODBCConnection2
oODBCConnection2.Open()
Dim myReader As OdbcDataReader = myOdbcCommand2.ExecuteReader()
Dim nestedRepeater as Repeater = e.item.FindControl("opts")
if (Not nestedrepeater Is Nothing) then
nestedRepeater.DataSource = myReader
nestedRepeater.DataBind()
end if
myOdbcCommand2.Connection.Close()
oODBCConnection2.Close()
end if
end sub
<asp:repeater id="questions" runat="server">
<headertemplate>
<itemtemplate>
<footertemplate>
id | question |
---|
<%#Container.DataItem("id")%> | <%#Container.DataItem("question")%> | | <asp:repeater id="opts" runat="server">
<headertemplate>
<itemtemplate>
<footertemplate>
<%#Container.DataItem("opt")%>
|
|
I there anyone out there smart enough to get it to work? What am I doing wrong.
|
|
|
|
|
It seems as though the forum has made swiss cheese out of my code. It put the bottom seciton on top and took out all of my web controls.... o well. I hope you can understand it anyway.
|
|
|
|
|
|
I'm still new to this and I'm not to sure about how to use the code behind. Is there anyway to do it without using one? If there isn't how do you use one.
|
|
|
|
|
You really should pick up a book on ASP.NET. It'll clear all this up including basic concepts like code-behind. Code-behind is exactly like a Windows Form. The controls and visuals are in one file and the code that manipulates them are in another, the code-behind page.
To answer your question, no, there is no way to do this without the code. There is no trick to "using" a code behind page. When you create an ASP.NET page, two files are created. One for the visuals and HTML, the .aspx file, and the code that controls them, the .aspx.vb file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I would like to use a for next loop with a Datagrid.
I have 2 grids in my form.
Dbgrid1 and Dbgrid2
In my Dbgrid1 I have 2 cols
Col1 has
2A
3B
4C
Col2 Has
10
20
30
I want to calculate the total on Col2 using For next
eg:
for i = 0 to 2
Total = Total + current(col2)
next
Then:
Insert the total in the first row of the second col of my second datagrid:
Can some one give me the code.
Tnx
|
|
|
|
|
Sounds like Homework !!!!
how are you filling the grids in the first place? a database?, from code?
Help is great only if you ask correctly
|
|
|
|
|
The grid is populated from the data table.
|
|
|
|
|
Hi all ... plz, i need a help in the tab control ...
How i can switch between the tabes without clicking on the tab header .. ??
The truth that i want to create a button, let us name it BtnNext, when click this button it switches me to the next tab ...
Thnx alot ..
|
|
|
|
|
Try this:
If sstbMyTabs.Tab < allTabsCountUp Then
sstbMyTabs.Tab = sstbMyTabs.Tab + 1
Else
sstbMyTabs.Tab = 0
End If
Cheers,
Pablo.ar
|
|
|
|
|
Hi,
I am trying to create a form with a gradient backcolor with labels on it. I get the gradient back color of the form by overiding the onpaint event of the form. However when I put a label with color.transparant on the form I just get the backcolor of the form, system grey. I found a coulpe of aricles about gradien labels, however then you get the problem that the gradient of the label doesn't match the gradient of the form. Is there a way to get some labels on a form that at least look transparent?
Thanks in Advance
DJ
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
You new to create your own custom label which inherits from the .Net Label and allows Transparent Back Colours. Here is the simplest version of such a control.
Public Class CustomLabel : Inherits Label
Public Sub New()
MyBase.New()
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Me.BackColor = Color.Transparent
End Sub
End Class
Myself, I have a much more complex label I have created that supports TextElipsis, AutoHeight and so on.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Hi,
Unfortunately this doesn't quite do the trick. With the backcolor being transparent, you get the backcolor of the form. However I am overriding the onpaint event of the form to create a gradient background (see code) Any other suggestions?
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim g As Graphics = Me.CreateGraphics
Dim myBrush As New LinearGradientBrush(ClientRectangle, Color.WhiteSmoke, _
Color.LimeGreen, LinearGradientMode.Horizontal)
g.FillRectangle(myBrush, ClientRectangle)
MyBase.OnPaint(e)
End Sub
thanks
DJ
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
Odd...
I have included the entire code of my test form here. When I run it I get the gradient applied uniformly even behind the label.
Imports System.Reflection
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As CustomLabel
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New CustomLabel
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(136, 128)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 0
Me.Label1.Text = "Label1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Public Shared Sub main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
Dim brush As New Drawing2D.LinearGradientBrush(Me.ClientRectangle, Color.Azure, Color.DarkGreen, Drawing2D.LinearGradientMode.BackwardDiagonal)
e.Graphics.FillRectangle(brush, Me.ClientRectangle)
brush.Dispose()
End Sub
End Class
Public Class CustomLabel : Inherits Label
Public Sub New()
MyBase.New()
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Me.BackColor = Color.Transparent
End Sub
End Class
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Hi,
Now it works. Made a mistake in the onpaint event...
Thanks for the help !!
Cheers DJ
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
hi
i need to know how can convert from number to words
thank you
|
|
|
|
|
Hey,
I have a dialog appear while a thread is running.
But on this dialog i want to place a cancel button that cancels the thread when it is clicked.
Is there anyway that VB.Net knows which threads are running in the app so it can kill them?
Thanks for your help, this is really important
Chris
|
|
|
|
|
I need to create one application("New.exe"):
with this event on Form1_Load:
hIr = FindWindow("Ir", vbNullString)
If IsWindow(hIr) = 0 Then
Call Shell("Ir.exe", 1)
Do Until IsWindow(hIr)
hIr = FindWindow("Ir", vbNullString)
DoEvents
Loop
It opens another application("IR.exe"), but I need to press one button of IR.exe, it reads three textboxes and it prints the values in my new application. But in hide mode!! It's possible ??
|
|
|
|
|
If it's hidden, no. This is because in order to receive input, like clicking on buttons, the app, and the target control, has to have the focus. In order to have the focus, the form must be visible.
If the app has shortcut keys (ALT-something) assigned to the buttons, then you can just use SendKeys to send the appropriate keystrokes that do the same thing as clicking the button. If not, it's MUCH more difficult, because now you have to know the coordinates of the button within the form and use the Win32 API function SendInput to send formatted mouse button messages to the target window.
Reading the text boxes will also not be easy. You must get the window handle of the textbox, send it the appropriate window message, I think it's WM_GETTEXT, and a pointer to a data structure that the textbox can write it's information to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can i place Progress bar in status-bar panel and how can i set the text property of status-bar panel in MDI Form from child form and is there any way i can change the form's title bar color.
|
|
|
|
|