|
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.
|
|
|
|
|
nitin_ten wrote:
How can i place Progress bar in status-bar panel
Public Class Form1
Dim progressBar As New ProgressBar
Dim progressPanel As New StatusBarPanel
Dim textPanel As New StatusBarPanel
Public Sub New()
MyBase.New()
InitializeComponent()
Dim statusBar As New StatusBar
statusBar.Parent = Me
statusBar.ShowPanels = True
textPanel.AutoSize = StatusBarPanelAutoSize.Spring
textPanel.Text = "Panel 1 Text"
statusBar.Panels.Add(textPanel)
progressPanel.Width = 120
statusBar.Panels.Add(progressPanel)
progressBar.Value = 50
progressBar.Height = statusBar.Height - 2
progressBar.Width = progressPanel.Width - 6
progressBar.Parent = statusBar
progressBar.Width = progressPanel.Width
progressBar.Location = New Point(textPanel.Width + 2, 2)
End Sub
Protected Overrides Sub OnResize(ByVal e As EventArgs)
MyBase.OnResize(e)
progressBar.Location = New Point(textPanel.Width + 2, 2)
End Sub
End Class
Hope this helps
Tom
|
|
|
|
|
Hi All,
Can U Tell me the Difference between DHTML and Web controls in VB6. I m waiting for your kind consideration. Thanx
|
|
|
|
|
What is DHTML?[^]
Web Controls are custom controls, written in VB6, that generate HTML.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I have a form in vb.net that use to search value in the database (msaccess) based on the user input. The result is display on the list view. The form that I connect to database is done by code, not by wizard. And I also design a report in crystal report. The result that search by the user will display in the report. My question is: how could I get value in the list view to display in (crystal) report? Or how could I display the value in the list in the simple HTML file?
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I'd like to learn how to build some simple applications. I'm just starting out, I shouold be doing this in classes next year but i'd love a head start. I hear this is all about math, and i'm not the best math student. Please, i have the program on my machine at home already, just help me, please. Thanks in advance.
|
|
|
|
|
Welcome to the coding community, simiyah.
First of all, you need to think about what you want your computer program to do... what task is hard for you to do yourself, and you want your computer to do it for you. For example, would it be fine to have a program that would autmatically solve algebraic phrases, so when you are doing your math homework, you don't have to? (I know you could use software that you already may have for this, but the point is doing it yourself!). Do you want a 'more' customizable notepad? Do you want a tetris where pieces could be moved in all directions (even 'up')? Think! the sky's the limit!
Pablo.ar
PS:It's not 'all' about maths...
|
|
|
|
|