|
I am working on a VB.Net application that will have forms with textboxes and datagrids and will populate with data from a database. When the user makes a change to a value or many values. How do I update my database,I do not mean how to write an Update statement. There are several tables involved and I am looking for the best way to update when the user hits the save button. Do I have to update all the tables or is there a better way to track modified fields.
Also, any suggestions on using Datadapter to fill dataset amd update modified rows datagrids.
Thanks
|
|
|
|
|
Hi,
I've searched hi and low to find out how you can draw outside of the Form, but haven't found anything!
Please can anyone help?
I'm trying to draw rectangles outside of my Form, of course it gets Clipped by the Form itself. I've tried to modify the Clip for the Form, but I can't seem to change it whatsoever. Is it possible to create a Graphics object for Windows itself? So that you can draw anywhere on the screen??
Any help or advice would be much appreciated!!
Many thanks!
Richard
|
|
|
|
|
I am looking for scripts or classes that can do the following:
1. Search through a set of folders for html files
2. Open the files one by one to parse
3. Count tags and attributes in each html document, tally how many of each in the document, and output the tallies to a file
4. Give properties of the html file, like file size
I've done asp.net development before, I just have never had to do any of these things. If you can help with any of these 4 things, I would greatly appreciate it. VB preferrably, but I could use C#.
Thanks so much.
I would rather do a VB Project than ASP.NET, but could use that code, too!
|
|
|
|
|
hello to all
i got some problem with child forms in my vb.net application.
in my application i need to maximize some child forms when they are loaded (set the windowstate to maximized at design time).
if i do so then, the next form opened which is not be maximized and the windowstate is also set to "normal" at design time also getting maximized (awwwwww it sucks). why this happens so ?. (i guess its setting the prev. forms window state .... )
i have set the maximizebox to "flase" for all the forms which i don't want to maximize and set the formboaderstyle to "fixedsingle"
to solve my problem what should i do ?
in short >> i want to retain the childforms windowstate property set at design time (not to be changed automatically at run time)
please some body help me out ...
adv. thanks
Mohan G
|
|
|
|
|
This is how Windows is designed. You can't change it and there is no way around this.
If you maximize a client window, they all get maximized. If you restore a client window to normal, they all are returned to normal.
If you want to simulate a miximized form, you'll have to size it to the client window area in code and update the size if the parent window's size changes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you rage
as you said its behaving the same
so i have changed my other forms to normal only (which were needed to load as maximized earlier) hope the problem will be solved ...
|
|
|
|
|
Hello,
i like to seperate an incoming string to an array. The values are delimited by commas.
input string format like "122.23, 232.0, 12.34"
I think of using the split function:
<br />
Dim inputstr as variant<br />
<br />
list = split(inputstr,",")<br />
<br />
After this i like to put the several values in double format variables. This require some typecasting, right? Does anybody has the syntax for the loop and the typecyasting? I am new to vb..
happy coding,
-mark
|
|
|
|
|
Hi Mark, not sure which version of VB you're using (VBA, VBCLassic, or VB.Net)
for splitting the string in VB.Net...
Dim input as Object = "122.23, 232.0, 12.34"
Dim arrList() as String = CStr(inputString).Split(","c)
for casting the remaining items from the stringarray to a double format recursively in VB.Net...
Dim arrCosts(arrList.GetUpperBound(0)) as Double
for i as Int32 = 0 to arrList.Length - 1
arrCosts(i) = Double.Parse(arrList(i).Trim)
next
arrCosts is an array of your Numbers in Double format.
hope this helps.
-jim
|
|
|
|
|
Thanks, i am using vba on excel 2003
happy coding,
-mark
|
|
|
|
|
mmh, by the way do you have an VBA implementation?
happy coding,
-mark
os win2000 vba office 2003, vc++ 6.0
|
|
|
|
|
sorry mark, i have absolutely 0 experience with vba and i don't want to give you bad information. this small bit shouldn't be that difficult to translate though.
actually, thinking about it, in vba are there any other data types other than variant? or am i thinking of vb script...
-jim
|
|
|
|
|
dim str as string
For Each str in list
Value = CDbl(str)
Next
This should probably work
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Hi,
confusing.. So how must be the code to read out the input string into the the double type text fields as shown below?
<br />
Dim input As Variant<br />
Dim value(1 to 3) AS double<br />
<br />
input = "122.23, 232.0, 12.04"<br />
.<br />
.<br />
.<br />
<br />
<br />
labelx.caption = value(1)
labely.caption = value(2)
labelz.caption = value(3)
happy coding,
-mark
os win2000 vba office 2003, vc++ 6.0
|
|
|
|
|
Dim i as integer
dim str as string = Split(input,",")
For i = 1 to 3
value(i) = CDbl(str(i-1))
Next
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
<br />
input = "122.23, 232.0, 12.04"<br />
<br />
<br />
Dim i As Integer<br />
Dim str() As String<br />
str = Split(input, ",")<br />
<br />
For i = 1 To 3<br />
value(i) = CDbl(str(i - 1))<br />
Next<br />
<br />
<br />
Labelx.Caption = value(1)
Labely.Caption = value(2)
Labelz.Caption = value(3)
Yeah, this works. But why are the output values no float variables?
happy coding,
-mark
os win2000 vba office 2003, vc++ 6.0
|
|
|
|
|
Hi All,
I need help here. I'm trying to drag a file to my application from windows explorer, then get the file pointer, then I simulate it as if I drag the file to another application, let's say Moto Application. I expect the result to be as the same as I drag the file to Moto Application.
However, the Moto Application somehow doesn't get the file pointer right. Please somebody help me...
Here's my code
<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
Implements IMessageFilter<br />
<br />
Public Declare Function DragQueryFile Lib "shell32.dll" Alias "DragQueryFileA" (ByVal HDROP As IntPtr, ByVal UINT As Integer, ByVal lpStr As String, ByVal ch As Integer) As IntPtr<br />
Public Declare Sub DragAcceptFiles Lib "shell32.dll" Alias "DragAcceptFiles" (ByVal hwnd As IntPtr, ByVal fAccept As Integer)<br />
Private Declare Sub DragFinish Lib "Shell32.dll" (ByVal hdrop As IntPtr)<br />
Public Declare Function SendMessageAsInt Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As Integer) As Long<br />
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr<br />
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As IntPtr, ByVal hWnd2 As IntPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr<br />
Public Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As IntPtr, ByVal wCmd As Long) As IntPtr<br />
<br />
Public Const WM_DROPFILES = &H233<br />
Public Const GW_CHILD = 5<br />
<br />
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements IMessageFilter.PreFilterMessage<br />
<br />
If m.Msg = WM_DROPFILES Then<br />
HandleDroppedFiles(m.WParam)<br />
Return True<br />
End If<br />
Return False<br />
End Function<br />
<br />
Public Sub HandleDroppedFiles(ByVal filepoint As IntPtr)<br />
Dim hndl As IntPtr<br />
Dim childhndl As IntPtr<br />
Dim sendstat As Integer<br />
hndl = FindWindow(vbNullString, "Motorola Sync v1.7")<br />
If hndl.ToInt32 <> 0 Then<br />
childhndl = GetWindow(hndl, GW_CHILD)<br />
childhndl = FindWindowEx(hndl, childhndl, "SysListView32", "List1")<br />
<br />
SendMessageAsInt(childhndl, WM_DROPFILES, filepoint, 0)<br />
End If<br />
End Sub<br />
|
|
|
|
|
Hi,how i can to transform
System.Drawing.Color -> System.UInt32 and backward.
System.UInt32 is value which contain OLE_COLOR data.
THANK
|
|
|
|
|
You might want to check out the handy System.Drawing.ColorTranslator class. Among a couple of other things, it has a "ToOle" method that takes a Color and returns an Integer.
Scott McMaster
|
|
|
|
|
i am filling my dataset and trying to show the record in the report but it's not showing i've checked the datset it's filled with records and to show it on report this is what i am doing
CrystalReport.SetDataSource(OleDataset)
CrystalReportViewer.ReportSource = CrystalReport
help me on this one.thanx in advance
|
|
|
|
|
the basic steps for doing this are:
1. create new .xsd file to describe your datasource (dataset)
2. create new .rpt (crystal report) template using .xsd file as your datasource. you can actually create the report at run-time, but that's more of a headache than you want to get into unless it's absolutely necessary. (i.e. you don't know that formatting of the report at design-time etc.)
3. create, populate and display your report:
Dim dsMyData as Dataset
Dim crMyReport as ReportDocument
Try
'--- code to populate your dataset here ---'
crMyReport = New ReportDocument
crMyReport.Load("..\Templates\myReport.rpt")
crMyReport.SetDataSource(dsMyData)
me.CrystalReportViewer1.ReportSource = crMyReport
This technique works best with strongly typed dataset, but is feasible with generic datasets as well. sometimes i have problems synchronizing the definition of the dataset with the actual dataset in memory and the report will not show any data. If this happens and i absolutely need to use a generic dataset i usually take care of this by just generating my dataset and serializing the data and schema out to an xml file. Then use this file as the source for my report template.
sorry for any typos, i just wrote this code off the top of my head.
hope this helps,
-jim
|
|
|
|
|
Hi i need a code for a OutlookBar
|
|
|
|
|
Start with a search[^] of the web.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there -
i want to do the following:
I have a class, call it clientView, that includes an imageBox and two labels. that imagebox and these two label i want to position like that:
IMAGEBOX
LABEL1
LABEL2
Now, in my main form, i have a hashtable that includes several clientView objects.
i want to position these clientView objects on my main Form like this (e.g. there are 3 objects of clientview in the hashtable):
IMAGEBOX1 IMAGEBOX2
LABEL1.1 LABEL2.1
LABEL1.2 LABEL2.2
IMAGEBOX3
LABEL3.1
LABEL3.2
now, because my hashtable is dynamic, if another object is added to it, i will call a function, that reorganises the view of the objects in my main Form. (e.g. number four was added):
IMAGEBOX1 IMAGEBOX2
LABEL1.1 LABEL2.1
LABEL1.2 LABEL2.2
IMAGEBOX3 IMAGEBOX4
LABEL3.1 LABEL4.1
LABEL3.2 LABEL4.2
maybe this is very easy, but i have no idea how to determine the right positions of my objects.
can anyone help me out of my mess???
thx for all helps.
greetings-
tom
|
|
|
|
|
tommy_tanaka wrote:
maybe this is very easy, but i have no idea how to determine the right positions of my objects.
can anyone help me out of my mess???
Actually, this is going to be some pretty complicated logic using very simple math.
First, one block of this data would be a good candidate for a custom control. Your control would be a single instance of the block of data you want to display, like ImageBox1, Label1, Label2. You wouldn't have to keep track of all the labels and image boxes, just the instance of the control that contains them.
Next, you'l have to do A LOT of planning and layout on paper. You'll need to know the dimensions of the client area (which can change!) that your going to display your control(s) in. You'll need to know the dimensions of your control(s), the spacing between the edge of the client area and your controls, the spacing between your controls, how many controls your going to display, and most of all, what the layout rules are.
Then, and only then, can you start putting the logic together and laying out the math that will calculate the positions of your custom controls.
It's not really that hard. It's just tedious and planning intensive.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok. sound not quiet difficult ... but i never created a custom control... but i think this will not be a big thing. can another class also be part of my custom control?
best i try to tell you what i'm doing:
i implemented a client-server application, where serveral clients send their screenshot to the server. the server keeps the shots of the clients, the pc and username in a class named "client".
and now i want to dislpay the screens of all the logged in clients, and also the name and the username (therefore: 1 imagebox and 2 labels). of course, the amount of the clients can be variable, depending how many clients are logged in.
so if a new client logs in, i create one of my custom control and if possible give it the client object in the constructor. and in the control itself, it gets the picture and text for the labels by the client-object.
if i fix the size of my mainForm, i think, this would be easier for me concerning positioning my controls...
|
|
|
|
|