|
Since this is a web application, you have no control over the focus from VB.NET. You'll have to add JavaScript to your web page to control the focus. But, I have no idea how to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
I do know how to set focus with javascript, in fact, I have a utility DLL compiled with my application for setting the focus on a specific control when a web page loads.
However, when I put that function in as the last statement of my .SelectedIndexChanged event -- I can see the focus go there, but it does not stay because the page gets refreshed again (I suppose).
William
|
|
|
|
|
Anonymous wrote:
However, when I put that function in as the last statement of my .SelectedIndexChanged event -- I can see the focus go there, but it does not stay because the page gets refreshed again (I suppose).
Yes it does. This is why you really can't control the focus from the server-side. The focus must be setup and controlled entirely in client-side JavaScript in your page.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
How can i get machine names on network?
system.net ... ???
|
|
|
|
|
|
There is an example here[^] on CodeProject. It's in C#, but is convertable to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dim WMI As Object<br />
Dim Processor As Object<br />
Set WMI = GetObject("WinMgmts:")<br />
Set Processor = WMI.Instancesof("Win32_Processor")<br />
<br />
For Each element In Processor<br />
msgbox element.SystemName<br />
next
The message box will show you System Name.
For Further See MSDN 2001 WMI CLASS
Shoaib Nawaz
|
|
|
|
|
This code won't show you all the machines on the network.
Though it'll show you all the processors on the local machine, it's not appropriate for getting the machine name.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm making a windows app. in .net. I've 5 combobox which has to be filled from 5 tables when form is loaded. Can anyone help me with a generic method to fill these. I'd like to know how to use a generic query & function.
Thanx in advance
|
|
|
|
|
Why couldn't you do something like this...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Load_DD(m_dd1, "SELECT * FROM CUSTOMER", "Customer_Name", "Customer_ID")
Load_DD(m_dd2, "SELECT * FROM PRODUCT", "Product_Name", "Product_ID")
etc...
End If
End Sub
Private Sub Load_DD(ByVal MyDropDown, ByVal MyQuery, ByVal MyText, ByVal MyField)
Dim ErrorMessage As String
Dim ds As DataSet
Try
ds = A_DB_Function_That_Returns_A_DataSet(MyQuery)
MyDropDown.DataSource = ds
MyDropDown.DataTextField = MyText
MyDropDown.DataValueField = MyField
MyDropDown.DataBind()
Catch ex As Exception
ErrorMessage = ex.Message
Finally
End Try
End Sub
|
|
|
|
|
Have you done ANYTHING yourself about this? I mean actually CODED or RESEARCHED the problem? Even READING the help files would be a great start. My advice to you is RTFM. Don't expect us to provide answers to your URGENT problem. Give us a break.
...Steve
|
|
|
|
|
Hi,
How can i arrange controls at desitrd locations while i am creating controls at run time.
i have given X,Y coordinates for position, and i set Docked property to Top.
i creating controls in a loop, Each control irrespective of their location coordninates control is adding at the top of the form. i have to position the control according to given location values.
Please help me out.
|
|
|
|
|
If you want to set the X,Y location of a control, you have to set it's Dock property to None. Since your setting it to top, it's doing exactly what it's told. Ignoring the location property and attaching itsefl to the top of the container, in your case - the form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
if i set Dockedproperty to none all controls are coming one behind the other.
|
|
|
|
|
Just set their Location.X and Location.Y properties and add them to whatever container your putting them in.
Dim myButton As New Button
myButton.Location = New Point(X, Y)
Me.Controls.Add(myButton)
Just be sure your not using the same X and Y values for the location.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
p'' This is my code,
''y position is not same for all the controls.
Dim y As Integer = 0
If Dv_Tag.Tables(0).Rows.Count > 0 Then
For i As Int16 = 0 To Dv_Tag.Tables(0).Rows.Count - 1
CheckBox1 = New CheckBox
AddHandler CheckBox1.Click, AddressOf CheckBox1_Click
CheckBox1.Size = New System.Drawing.Size(150, 24)
CheckBox1.Location = New System.Drawing.Point(25, y + 28)
CheckBox1.SetBounds(25, y + 28, 150, 24)
Me.Controls.Add(CheckBox1)
Next
End If
End Sub
|
|
|
|
|
pavani123 wrote:
For i As Int16 = 0 To Dv_Tag.Tables(0).Rows.Count - 1
CheckBox1 = New CheckBox
AddHandler CheckBox1.Click, AddressOf CheckBox1_Click
CheckBox1.Size = New System.Drawing.Size(150, 24)
CheckBox1.Location = New System.Drawing.Point(25, y + 28)
CheckBox1.SetBounds(25, y + 28, 150, 24)
Me.Controls.Add(CheckBox1)
Next
pavani123 wrote:
y position is not same for all the controls.
Where are you changing the value of y in this loop? Every iteration of this loop uses the exact same value of Y because you never change it. You might want to change your code a bit to do this.
For i As Int16 = 0 To Dv_Tag.Tables(0).Rows.Count - 1
CheckBox1 = New CheckBox
AddHandler CheckBox1.Click, AddressOf CheckBox1_Click
CheckBox1.Size = New System.Drawing.Size(150, 24)
y+=28
CheckBox1.Location = New System.Drawing.Point(25, y)
CheckBox1.SetBounds(25, y, 150, 24)
Me.Controls.Add(CheckBox1)
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Thanks, i did't catch this small thing.
Thanks alot.
|
|
|
|
|
in a rich Textbox i wanna show some words as link (for example when u write www.codeproject.com , u see a web link ) but I wanna do the same for some words. After that I have to catch , this link whether is clicked or not.
How can I do ?
|
|
|
|
|
you can write like this.
Text here...
I think thats it.
Regards,
Asim
|
|
|
|
|
Some Queries i need answers for this queries
that will support 4 sql server
Note: all of this are done using a single query.
1. how to find the desired maximum of a column ,1st,2nd..etc.,
2. display the middle row of a table if 7 rows then we should show 4th is the middle
3. how to display the last day of the month
V.Gopi.
Easy Design Systems
Coimbatore
India
|
|
|
|
|
I want to enable TCP\IP protocol for sqlserver, for my client server application, at server side. Becoz i m using MSDE as database. I can enable it through by using SvrNetcn.exe, but want to enable it by vb.net code or by command line or any other way with out using any User Interface. How i can do that?
SEC
|
|
|
|
|
Hi I am trying to update record using this syntax,
SqlStr = "Update table1 SET table1.column_name =" & texbox.Text"
The problem is in the textbox, there is a quote in the middle of the string (') which VB cannot read. How do I convert that quote so that the vb can read the the sql string.
dw1928
|
|
|
|
|
when passing the string try this
texbox.Text.Replace("'","''") <---
Dont worry it will store singe (') in the Database
_mubashir
|
|
|
|