|
hi,
all
i m still trying to findout the soln. for using tdb or flexigrid in vb.net windows application, here i m using dataset.
pls. i need favourable answer. i am waiting.......
hi this ajay bharti
-- modified at 5:29 Monday 21st November, 2005
|
|
|
|
|
Hi Ajay,
There are may examples of using FlexGrid.NET and TDBGrid.NET with a dataset. For FlexGrid.NET, please begin by taking a look at the BoundDelete sample. For TDBGrid.NET, please begin by referring to Tutorial1.
If you are using the ActiveX versions of FlexGrid and TrueDBGrid in VS.NET, while it is recommended that you use the versions for VS.NET, the ActiveX versions should still work reasonably well. If you are trying to use the ActiveX versions, you also need to use the ActiveX version of ADO (Microsoft ADODB) or our TrueData ActiveX control. For an example, convert any of the ActiveX samples to VS.NET using VS.NET's automatic conversion.
Additional samples can be found on our website, http:\\www.ComponentOne.com[^]. The direct link to our samples page is http://helpcentral.componentone.com/ProductResources.aspx?View=Samples[^]. If you continue to have problems, you can either let me know through the VB.NET group or contact our support team for assistance. Options for contacting support are available on our support options[^] page.
Suelinda W
Customer Engagement, ComponentOne LLC
|
|
|
|
|
All,
I have seen a lot of examples for VB 6.0 and less to create a toolbar that is dockable on the desktop edges which then automatically moves your icons around so everything is still viewable. I am currently trying to find an example in VB 2005. I can create a dockable toolbar on all sides of the screen but I can not get it to move icons and things like that. It is basically, more or less, and form with transparency enabled and then the toolbar can move to each side. I hope that this explains what I would like to do. Basically it is like the Office 2000 Toolbar.
Thanks for any help.
Jason
|
|
|
|
|
|
I've used this code and it works well:
<br />
Imports System<br />
Imports System.Drawing<br />
Imports System.Collections<br />
Imports System.ComponentModel<br />
Imports System.Windows.Forms<br />
Imports System.Data<br />
Imports System.Runtime.InteropServices<br />
<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
<br />
Public Sub New()<br />
MyBase.New()<br />
<br />
'This call is required by the Windows Form Designer.<br />
InitializeComponent()<br />
<br />
'Add any initialization after the InitializeComponent() call<br />
<br />
End Sub<br />
<br />
'Form overrides dispose to clean up the component list.<br />
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
If disposing Then<br />
If Not (components Is Nothing) Then<br />
components.Dispose()<br />
End If<br />
End If<br />
MyBase.Dispose(disposing)<br />
End Sub<br />
<br />
'Required by the Windows Form Designer<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
'It can be modified using the Windows Form Designer. <br />
'Do not modify it using the code editor.<br />
Friend WithEvents Button1 As System.Windows.Forms.Button<br />
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
Me.Button1 = New System.Windows.Forms.Button()<br />
Me.SuspendLayout()<br />
'<br />
'Button1<br />
'<br />
Me.Button1.Location = New System.Drawing.Point(72, 80)<br />
Me.Button1.Name = "Button1"<br />
Me.Button1.Size = New System.Drawing.Size(80, 40)<br />
Me.Button1.TabIndex = 0<br />
Me.Button1.Text = "Close"<br />
'<br />
'Form1<br />
'<br />
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)<br />
Me.ClientSize = New System.Drawing.Size(292, 266)<br />
Me.Controls.Add(Me.Button1)<br />
Me.Name = "Form1"<br />
Me.Text = "Form1"<br />
Me.ResumeLayout(False)<br />
<br />
End Sub<br />
<br />
#End Region<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
RegisterBar()<br />
End Sub<br />
<br />
Structure RECT<br />
Public left As Integer<br />
Public top As Integer<br />
Public right As Integer<br />
Public bottom As Integer<br />
End Structure 'RECT<br />
<br />
<br />
Structure APPBARDATA<br />
Public cbSize As Integer<br />
Public hWnd As IntPtr<br />
Public uCallbackMessage As Integer<br />
Public uEdge As Integer<br />
Public rc As RECT<br />
Public lParam As IntPtr<br />
End Structure 'APPBARDATA<br />
Enum ABMsg<br />
<br />
ABM_NEW = 0<br />
ABM_REMOVE = 1<br />
ABM_QUERYPOS = 2<br />
ABM_SETPOS = 3<br />
ABM_GETSTATE = 4<br />
ABM_GETTASKBARPOS = 5<br />
ABM_ACTIVATE = 6<br />
ABM_GETAUTOHIDEBAR = 7<br />
ABM_SETAUTOHIDEBAR = 8<br />
ABM_WINDOWPOSCHANGED = 9<br />
ABM_SETSTATE=10<br />
<br />
End Enum<br />
Enum ABNotify<br />
<br />
ABN_STATECHANGE = 0<br />
ABN_POSCHANGED<br />
ABN_FULLSCREENAPP<br />
ABN_WINDOWARRANGE<br />
<br />
End Enum<br />
Enum ABEdge<br />
<br />
ABE_LEFT = 0<br />
ABE_TOP<br />
ABE_RIGHT<br />
ABE_BOTTOM<br />
End Enum<br />
<br />
<br />
<br />
Private fBarRegistered As Boolean = False<br />
<br />
Public Declare Function SHAppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" (ByVal dwMessage As Integer, ByRef pData As APPBARDATA) As System.UInt32<br />
Public Declare Function GetSystemMetrics Lib "User32.dll" Alias "GetSystemMetrics" (ByVal index As Integer) As Integer<br />
Public Declare Function MoveWindow Lib "User32.dll" Alias "MoveWindow" (ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal repaint As Boolean) As Boolean<br />
Private Declare Auto Function RegisterWindowMessage Lib "User32.dll" (ByVal msg As String) As Integer<br />
Private uCallBack As Integer<br />
<br />
Private Sub RegisterBar()<br />
Dim abd As New APPBARDATA()<br />
abd.cbSize = Marshal.SizeOf(abd)<br />
abd.hWnd = Me.Handle<br />
If Not fBarRegistered Then<br />
uCallBack = RegisterWindowMessage("AppBarMessage")<br />
abd.uCallbackMessage = uCallBack<br />
<br />
Dim ret As System.UInt32 = SHAppBarMessage(CInt(ABMsg.ABM_NEW), abd) 'ToDo: Unsigned Integers not supported<br />
fBarRegistered = True<br />
<br />
ABSetPos()<br />
<br />
Else<br />
SHAppBarMessage(CInt(ABMsg.ABM_REMOVE), abd)<br />
fBarRegistered = False<br />
End If<br />
End Sub 'RegisterBar<br />
<br />
<br />
Private Sub ABSetPos()<br />
Dim abd As New APPBARDATA()<br />
abd.cbSize = Marshal.SizeOf(abd)<br />
abd.hWnd = Me.Handle<br />
abd.uEdge = CInt(ABEdge.ABE_TOP)<br />
<br />
If abd.uEdge = CInt(ABEdge.ABE_LEFT) Or abd.uEdge = CInt(ABEdge.ABE_RIGHT) Then<br />
abd.rc.top = 0<br />
abd.rc.bottom = SystemInformation.PrimaryMonitorSize.Height<br />
If abd.uEdge = CInt(ABEdge.ABE_LEFT) Then<br />
abd.rc.left = 0<br />
abd.rc.right = Size.Width<br />
Else<br />
abd.rc.right = SystemInformation.PrimaryMonitorSize.Width<br />
abd.rc.left = abd.rc.right - Size.Width<br />
End If<br />
<br />
Else<br />
abd.rc.left = 0<br />
abd.rc.right = SystemInformation.PrimaryMonitorSize.Width<br />
If abd.uEdge = CInt(ABEdge.ABE_TOP) Then<br />
abd.rc.top = 0<br />
abd.rc.bottom = Size.Height<br />
Else<br />
abd.rc.bottom = SystemInformation.PrimaryMonitorSize.Height<br />
abd.rc.top = abd.rc.bottom - Size.Height<br />
End If<br />
End If<br />
<br />
' Query the system for an approved size and position. <br />
SHAppBarMessage(CInt(ABMsg.ABM_QUERYPOS), abd)<br />
<br />
' Adjust the rectangle, depending on the edge to which the <br />
' appbar is anchored. <br />
Select Case abd.uEdge<br />
Case CInt(ABEdge.ABE_LEFT)<br />
abd.rc.right = abd.rc.left + Size.Width<br />
Case CInt(ABEdge.ABE_RIGHT)<br />
abd.rc.left = abd.rc.right - Size.Width<br />
Case CInt(ABEdge.ABE_TOP)<br />
abd.rc.bottom = abd.rc.top + Size.Height<br />
Case CInt(ABEdge.ABE_BOTTOM)<br />
abd.rc.top = abd.rc.bottom - Size.Height<br />
End Select<br />
<br />
' Pass the final bounding rectangle to the system. <br />
SHAppBarMessage(CInt(ABMsg.ABM_SETPOS), abd)<br />
<br />
' Move and size the appbar so that it conforms to the <br />
' bounding rectangle passed to the system. <br />
MoveWindow(abd.hWnd, abd.rc.left, abd.rc.top, abd.rc.right - abd.rc.left, abd.rc.bottom - abd.rc.top, True)<br />
End Sub 'ABSetPos<br />
<br />
<br />
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)<br />
If m.Msg = uCallBack Then<br />
Select Case m.WParam.ToInt32()<br />
Case CInt(ABNotify.ABN_POSCHANGED)<br />
ABSetPos()<br />
End Select<br />
End If<br />
<br />
MyBase.WndProc(m)<br />
End Sub 'WndProc<br />
<br />
<br />
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams<br />
Get<br />
Dim cp As CreateParams = MyBase.CreateParams<br />
cp.Style = cp.Style And Not &HC00000 ' WS_CAPTION<br />
cp.Style = cp.Style And Not &H800000 ' WS_BORDER<br />
cp.ExStyle = &H80 Or &H8 ' WS_EX_TOOLWINDOW | WS_EX_TOPMOST<br />
Return cp<br />
End Get<br />
End Property<br />
<br />
Private Sub End_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
RegisterBar()<br />
End<br />
End Sub<br />
End Class<br />
Hope this helps,
Michael
|
|
|
|
|
When I move the cursor to the last row in my DataGrid a new record is added to the DataView. The new row fields contain DBNull values. When the new row is added how can I automatically assign values to these fields so they are not null?
Thanks
|
|
|
|
|
Programmatically you do it like this.
DataSet1.Tables("TABLE_NAME").Columns("COLUMN_NAME").DefaultValue = "Me"
Otherwise go into your dataset properties and then tables and finally columns. Once there click on your column and find the property DefaultValue.
HTH,
Jason
|
|
|
|
|
What is the syntax when using the finally columns?
|
|
|
|
|
Finally mean final step!
Regards,
Asim
|
|
|
|
|
I am trying to populate a combobox from an XML and I am not sure if the data should be stored as an attribute like this <bolt_standards a="Metric" b="UNC/UNF">, which can not be numbers only or <m5>10,12,14,16,20,25,30,35,40,50, and extract the whole string and use a delimiter "," used to split the values or possibly like this
<m6>
0 = "12"
1 = "16"
2 = "20"
3 = "25"
4 = "30"
5 = "35"
6 = "40"
7 = "45"
8 = "50"
9 = "55"
10 = "60"
11 = "65"
12 = "70"
13 = "75"
14 = "80"
15 = "90"
16 = "100"
|
|
|
|
|
|
What I am trying to do is read a text file and count the amount of instances where there is a value after the string I am searching
For example(example of the text file which may have 12 houses)
house1=This spot is taken
house2=This spot is taken
house3=
house4=
I want to search through the text file for the "=" then see if there is any data after the "="...
The Readline() method will help me read the text file line by line and I can also use an if statement to see if the "=" is on the particular line...but how do I gather the characters after the "="
Thanks
Andrew
|
|
|
|
|
Once you've read a line, use the Split() function to break it down into two parts which are delimited by the "=" sign thus:
' Assume sInput holds the line just read from the file...<br />
<br />
Dim arr() as string<br />
arr = Split(sInput, "=", 2)<br />
<br />
' arr(0) now contains the text before the "=" sign<br />
' arr(1) now contains the text after the "=" sign<br />
If there is no text after the "=" sign then arr(1) will be an empty string.
...Steve
|
|
|
|
|
That worked great thanks!
Is there a way to point the cursor to a specific part of the text file? like if I wanted to only read lines 7-30 of the text file? or even from a specific word in the text which is basically a title to the block of text
for example...
This section here is garbage but there is an = here
[This is the title of the block I want to work with]
house1=This spot is taken
house2=This spot is taken
house3=
house4=
I do not want to read any more information after house 4 for instance
Andrew
|
|
|
|
|
kongo10 wrote: That worked great thanks!
You're welcome.
kongo10 wrote: Is there a way to point the cursor to a specific part of the text file? like if I wanted to only read lines 7-30 of the text file? or even from a specific word in the text which is basically a title to the block of text
Hmmm.... how large is the file? In the VB 6.0 way you could call the kernel GetPrivateProfileString() INI file function and it's supporting functions to go to the requested section and obtain the value automatically (almost) but in .NET this is shunned in favour of using XML files.
These subjects are a little harder to put into a few words here, so I'd suggest searching the net (or www.codeproject.com articles) for suitable code.
Another suggestion is that if the file is relatively small and/or only going to be read all the way through once in your program is to simply read the file line-by-line until you get to where you want to start then parse the data as per previous reply in this thread. Much simpler although not quite as 'correct'.
...Steve
|
|
|
|
|
Hi all, I'm trying to have the parent form auto populate the three fields to its subform. Is this posilble??? Help!!!
thank you in avdance.
|
|
|
|
|
What do you mean by auto populate fields. Are you saying you want to open a form and then once the form is open have data sent to three different text boxes in the sub form?
VBA Code
Form_FormName.TextBoxName.Value = ""
or
Form_FormName.TextBoxName.Text = ""
HTH,
Jason
|
|
|
|
|
Thanks, But i try that and didn't work. It is possible that I'm l doing something wrong.
This is what is did:
I go to the code envir - form afterupdated of the subform then i type the
Form_Crs.crs_cd.Value = ""
Please tell what am I doing wrong?
Thanks
|
|
|
|
|
Hello all...
I a windows service that starts a new thread in the onstart event to do the work. The work has a while loop that listens to a TCP connection which blocks on the stream.read call. There may or may not be any packet for up to 30 seconds and I need to update data more often than that, about every one second. I have a timer which should tick every 1 sec but the while loop that listens to the TCP stream seems to keep the tick event from firing. The timer.start call is inside the thread. Any ideas on how to get that tick event to fire? Or a better solution?
Thanks in advance...
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
hellow to all ..
how can i convert a sting to a date type ..
and then substract it from another date ?
|
|
|
|
|
What i did is adding the "/" and "#" to the string and get the difference by using DateDiff
So, it's like this
dim d as date
d = "#" + month.Tostring + "/" + date.Tostring + "/" + year.tostring + "#"
dim day as integer
day = DateDiff(DateInterval.Day, d, WhateverDate)
You can change the Dateinterval to your liking.
Hope that helps
|
|
|
|
|
Hi guys!
need some help..
i want to use hindi fonts in my application also i want to save the data in sql2000 in hindi..for displaying it later
can any one help me as i m searching for it but cant find the appropriate help.
abhinav
|
|
|
|
|
How do I create a Validated event for a TextBox that is in a DataGrid?
Thanks
|
|
|
|
|
I am recreating a program originally written in Foxpro, which is nearly complete. I am running into a design problem causing me some grief. Basically the program is a form connected to a database displaying the fields in texbox. The original Foxpro program saved the changes made if the person moved out of the textbox, or tabbed out. Pretty convienent for them, and they are used to that. The Foxpro update is almost instant.
Ok mine has an update button, takes about 9 seconds for the adapters to update. If I tie this into any control it will take that long. I know that the design is different, but is this what I am stuck with ? I know nothing of Foxpro but it seems it is updated just that one field and mine is updating everything ? Mine is updating like this...
dataset1.Update(ChangedRows)
|
|
|
|
|
You could try using the OleDbCommand instead of the DataAdapter for your update. You will have less overhead. Also Dataset1.Update updates the whole DataSet which takes more time then updating one table row using OleDbCommand. Not sure how much of a difference this will make. 9 seconds seems like along time - is the database server being over worked?
I'm a long time FoxPro programmer switching to VB .Net and I can say in your example FoxPro will always be quicker because in FoxPro the table is already opened and at the correct record. In VB .NET you have to make a connection and send the update command.
|
|
|
|