|
Hi,
I am having a form with a datagrid control. I have few textboxs and comboboxs to receive data from user. On compliting the entry in these textboxs and combo boxes, the user presses a command button which enters the contents to the datagrid. and it clears all the textboxs,comboboxs to added the new contents. And then next record in entered to the datagrid. Finally on pressing a command button only the two records should be added to the database.
1. How to add data to datagrid by each cell. I have done it using datasource.
2. Is it possible to temporary display data and on pressing a button it has to perminently add to database.
3. Can we add more than one record at a time in datagrid.
Thank you,
Anu.
|
|
|
|
|
Dear friend,
You can use dataset to store the information. The datagrid is actually set it's datasource to the datagrid. So when the dataset is updated, the datagrid will update too.
Regards,
Cherhan
p/s: Feel free to email me at leoforum2003@hotmail.com if u need further help.
|
|
|
|
|
Hi Cherhan,
Let me thank you for every thing.
Actually I am using VB.6, can I use dataset in it. Sorry if I have asked a basic question. I am very new to VB. I am learning on my own.
It will be helpful if u could write little bit in detail. I mean algoritham.
Thank you very much
Anu
|
|
|
|
|
Hi Anu,
I don't think your request can be achieved as VB 6 does not support this dataset concept. The offline concept is only available in VB .NET or above.
Which means this is a new thing in .NET FrameWork.
Regards,
Cherhan
|
|
|
|
|
Hi,
I'm having trouble placing multiple controls onto a VB6 form dynamically. I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25).
This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour.
Any suggestions. Perhaps creating a lightweight control in visual C may be the answer but I wouldn't know where to start.
Any help would be more than welcome,
Alan ...
Keep the Pound - reject the Euro
|
|
|
|
|
newalfi wrote:
I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25).
This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour.
Don't even think of it! Every picturebox you make uses a window, brush, pen, etc (and if you use AutoRedraw, a DC). If you need that many, it's long past time to make a custom control. You can even write it in VB6.
PS: What do you need it for -what's it's purpose? Maybe I can give you some guidance as to how to go about it.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
The student is trying to simulate an Air Traffic Control workstation and needs to be able to maintain 'Cards' showing various aspects of incoming and overflying aircraft.
So far, he is showing about 200 cards on the screen each containing (I think) flight number, altitude, heading, and another text line of about 15 characters whose data I am not sure about.
As the beginners VB lecturer, I have been asked to help but I havbe never created a custom control in any language.
Again, any help or guidance would be greaty appreciated.
Alan ...
|
|
|
|
|
Perhaps you could do this:
Make a class that represents a flight card. Make an array of objects of that type in your form class. Each time you re-draw the form, draw each flight card object in the array directly onto your form (or a single picture box on your form). You might want to set AutoRedraw to True, so that you don't have to re-draw all 200 cards every time the form re-paints. This way, you'll just have to re-draw every time the cards change.
HTH
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thanks for that. I'll experiment at home before suggesting to the student but it sounds as though this might work. I'm not aware of an upper limit for class objects.
Thanks again,
Alan ...
|
|
|
|
|
Hello,
how can I create a Shell Extension Handler using VB.NET ? Please, it is very urgent.
Best Regards
Alfredo DS
|
|
|
|
|
I'm currently testing an application written in VB.NET using Mecury WinRunner. WinRunner doesn't seem to have very good support for the Windows Forms DataGrid control, so I'm planning on writing a DLL to work as a layer between WinRunner and the control. I'm not very familiar with .Net, most of the programming I do is in C++ using the Win32 API. With the Win32 API you can communicate with most controls by using the SendMessage function. Does the datagrid control respond to messages, or would it be possible for me to somehow clone the control only knowing it's HWND? I need to be able to access the data in the control, as well as be able to get/set the currently selected row, column, or cell. Any help would be greatly appreciated.
|
|
|
|
|
Hi Guys, I have a baffling problem with the MSComm control in a VB6 app I'm writing. I'm trying to send a binary command out the serial port, then read a binary response. The command is 6 bytes and the response is 17. When I single-step over the .Output statement, everything works just fine. But if I set the breakpoint after the .Output statement, i.e. I'm executing at full throttle through the .Output, the received data is mostly lost. I do wait until .OutBufferCount goes to zero and DoEvents to make sure any messages are getting processed.
Another strange symptom is that I'm not seeing any OnComm events. I've set .RThreshold = 1 to try to catch the response data byte by byte, but not a blip from the OnComm event handler.
Here's the snippet of initialization code I'm using:
With MSComm1
.CommPort = Port
.Settings = Baud & "," & Parity & "," _
& DataBits & "," & StopBits
.RTSEnable = True
.DTREnable = True
'read entire buffer when Input is used.
.InputLen = 0
'we're dealing with binary data
.InputMode = comInputModeBinary
.RThreshold = 1
.PortOpen = True
End With
And here's what I'm doing in the command/response code:
'everything works fine if I put a breakpoint on the following
'line and single-step over the .Output statement
MSComm1.Output = cmdGetData
Do Until MSComm1.OutBufferCount = 0
DoEvents
Loop
'this hangs because we never get the full 17 bytes of data
While MSComm1.InBufferCount < 17
DoEvents
Wend
Lastly, everything seems fine when using ASCII (string) data, so I'm wondering if there's something peculiar about binary.
Thanks in advance for any insights.
-- Dave
QRZ? de WAØTTN
|
|
|
|
|
Need a quick class/component that is free in order to create email with SMTP. I am right in thinking there is no built in class to do this? I also need to include attachments.
|
|
|
|
|
Actually, there is a class. There all located within the System.Web.Mail Namespace. Look it over, and if you still can't understand how to use them, feel free to email me
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
How can i Print the contents of the listview control to Printer .Can any body help me with source code.
|
|
|
|
|
the total row will not scroll when the scrollbar scroll
|
|
|
|
|
Hi,
I am looping through a database and creating dropdown
lists dynamically using the combobox control and binding
it to an arraylist with valid values. However I must be
doing something wrong because when I run the code, all the
comboboxes are linked together, in other words if I change
the value of one of the comboboxes, all of them are
changed. Here is some sample code:
------------------------------------------------
Dim fieldlabel As Windows.Forms.Label
Dim filefields As Windows.Forms.ComboBox
While myreader.Read
If myreader("FLD_0") <> "/" Then
Panel1.Controls.Add(New Windows.Forms.Label)
fieldlabel = Panel1.Controls(controlindex)
fieldlabel.Text = counter & ") " & X3Reader("FLD_0")
fieldlabel.Location = New Point(1, ycord)
fieldlabel.Size = New Size(100, 20)
fieldlabel.Name = "label" & counter
controlindex += 1
Panel1.Controls.Add(New Windows.Forms.ComboBox)
filefields = Panel1.Controls(controlindex)
temparrlist = New ArrayList
temparrlist = filefieldsarrlist
filefields.DataSource = temparrlist
filefields.DropDownStyle = ComboBoxStyle.DropDownList
filefields.Size = New Size(100, 20)
filefields.Location = New Point(105, ycord)
filefields.Name = "map" & counter
controlindex += 1
ycord += 30
counter += 1
controlindex += 1
End If
End While
-------------------------------
Any ideas?
|
|
|
|
|
The application like to monitoring the operation of mechine to link with computer???Please reple!Thanks.;
yeowlee4u
|
|
|
|
|
We need alot more information on what you want to do and how the two machines are connected!
Are they connected over some type of network or serial port or some custom A/D card, or what?
RageInTheMachine9532
|
|
|
|
|
Operator machine like monitoring operator machine
|
|
|
|
|
Hi,
How to do transfer of files using VB and HTTP protocol? Actually wnat to transfer a file in unix which has only HTTP port enabled and all other port disabled. So would like to know how to do it.
Thanks
vishal
|
|
|
|
|
You can try using the inet control with GET / POST http commands
|
|
|
|
|
Hello,
I'm trying to build a application in ASP.NET for integration with VSS. I wrote a class library in VB.NET and tested it on normal Windows Application. It is running OK but when i call the same from a ASP.NET page, the connection to the VSS database fails. the error says "cant connect to database raj(its the username not DB name), Select another database".
please help me in figuring out the problem.
Also, is it possible to extract a perticular version of a source code from VSS and put it into a external folder??
thanks,
Raj
|
|
|
|
|
Hi all .. I have developed a program called Memorizer .. it provides many funny services .. like : Clock , Alarm , Showing random messages while you are working on your PC .. Changing characters as you do with MS Office....and you can make it do some animations ..and speaks text you write in a textbox .. furthermore .. you can open a textual file and it will read it for you ... it responds to some actions inside the program ..by playing proper animations and speaking statemnets suit the situation...The problem is that .. when I run it on My Machine it speaks the words inside the Ballon .. and I hear the voice ..but when I distributed it to the others .. the words it speaks appear in the ballon but they cannot hear what he speaks .. noting that the animations it play make some sound and they hear it ... Now I want to know how to show the ( Advanced Character Options ) dialog box from my VB.NET code .. to make the users try the checkbox of " Speak words In ballon" so how can I show it to my users .. or is there any other way .. give me a hand plz .. thanks for your co-operation ..
Kareem Shaker
|
|
|
|
|
I've got a string variable that goes through heavy string manipulation that may or may not leave the string with a 'carriage return - line feed' at the end.
It is declared like this:
Dim buf as String<br />
Dim filenum as Integer
Now i'm trying to output this string into a file and this is JUST ONE of the ways i've tried:
filenum = FreeFile<br />
Open "newfile.txt" For Output As filenum<br />
Print #filenum, buf<br />
Close filenum
Now here's my problem: No matter how i try this, after opening the file in an external editor I see that a 'carriage return - line feed' has been added to the end. I can't seem to avoid this and it's DRIVING ME CRAZY!
When 'buf' has a final character of '.', then when I open the file in my editor and press <Ctrl>+<End>, I expect the cursor to fall to the right of the '.' not on the blank line below. And before you ask, the editor I'm using doesn't do anything extra like ensuring a blank last line (like the VB environment).
I've tried various combinations of: opening the file in binary or text mode, opening for input or random, using the 'Print' or 'Put' function.
Can anybody tell me how to output a string to a file WITHOUT adding a blank last line?
thanks,
nebbish
Smart, Sexy, Sane. Pick two.
|
|
|
|