|
:(Help!
I'm trying to load an icon file into a picturebox using the following code:
PictureBox1.Image = Image.FromFile("cow.ico")
When executed an "Out of Memory Exception" is thrown every single time. My development machine has 1GB of RAM, and when this happens I have well over 1/2GB of physical memeory available, never mind the page file.
The rest of the program isn't very big. There is an array of about 3000 elements in there, but the exception is thrown before that array is initialized or filled.
Could this be a problem with my icon file? I use it in several other places with no problems... It does have every possible icon size/colour depth but is only 49K on the drive.
What is also curious is that this line works fine (it follows the above) when I comment the picturebox line out:
Me.Icon = new Icon("Cow.ico")
-Allan
|
|
|
|
|
i just tried it and it worked fine :
PictureBox1.Image = Image.FromFile("C:\7.ico")
you must have the exact path of the image in there or it will error.
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
Hello Friends,
I wanted to freeze the columns from datagrid like how we have functionality in Excel.
If any know how to do then pls tell me how to do.
If u send me demo project having with above functionality then it will be easy for me to understand.
Reply me as soon as possible.
|
|
|
|
|
Hi
Ive written a "select folder" dialog using a DriveListBox & a DirListBox . The limit for this is that i can only open folders on local or mapped drives.
I would like to update this to match the windows standard tree which includes the desktop throu to network places - allowing UNC paths to be opened.
Any pointers gratefuly recived..
Ta.
|
|
|
|
|
Try the SHBrowseForFolder[^] function (you're using VB6, not VB.NET, right?).
"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
|
|
|
|
|
|
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
|
|
|
|