|
Sounds like you're downloading VB6 code. They are totally different.
No-one will do your homework for you ( well, I hope they won't ). What has your teacher asked you to do ? Is this a console program ? Text display on windows program ? Graphics driven ? 3D ? Do you hope to teach your game how to play against a player ? What code have you written ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am building a control I use to edit my company objects...but in some of my forms I do not want a certain button to be visible...I provided a property for the button that I can see at desgn time so that on those forms I can set the button to be invisible:
<Browsable(True), _
DefaultValue(GetType(DevExpress.XtraEditors.SimpleButton))> _
Public Property UpdateButton() As DevExpress.XtraEditors.SimpleButton
Get
Return btnUpdate
End Get
Set(ByVal value As DevExpress.XtraEditors.SimpleButton)
btnUpdate = value
End Set
End Property
But for some reason when I rebuild my project, I lose this setting and the control shows again...Any one have any idea what I could be doing wrong?
Pablo
while(1){DoTheDo();}
|
|
|
|
|
please help me, change font of windows system, EX: title font, menu...
please help me, thanks
kevil
|
|
|
|
|
Do you want to do it programmatically or manually?
If you want to do it manually, you can change the appereance in display settings.
- Go to Control Panel -> Display.
- Klik apppereance tab and then change it as you like.
if you want to program it you had to change the value in the registry by using registry object and set the value as you like.
|
|
|
|
|
I have a datagridview that have 7-8 columns. 3 of them is comboboxes with values that the user selects from.
I need the second of the comboboxes to change it lists of values depending of the values in the first. The third must change its values depending on the two first.
Anyone got any tip?
|
|
|
|
|
How about you make your own print preview dialog?
|
|
|
|
|
Thankyou so much for replying. you literally beat me to posting a new message to get some information about "printpreviewcontrol". i've searched everywhere and cannot find some source code or material to get me started to create my own PRINT PREVIEW. can you assist with some sites or material please.
Thanks
Robbo
|
|
|
|
|
Hello, I am a beginner in VB.net programming (or in general..) and I am getting this "NullReferenceException: Object reference not set to an instance of an object" when I try assigning strings to an array..what am I missing?...if I make it an arraylist instead, it works ok except that things are stored in a way that I do not really know how to work with. What is the difference between array and arraylist in vb.net?.. Thanks all for your help!
Below is my code that gives me the null reference error.
Imports System.IO
Public Class Form1
Dim isotope, mass_frac, Sp_A, gammaE, absCoeff, attenCoeff As ArrayList
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
Dim templine As String = Nothing
Dim strInp() As Array = Nothing
Dim PI(), PIstrList() As String
Dim i, j As Integer
Dim l As Integer = 0
Dim k As Char
isotope = New ArrayList()
Dim saparator() As Char = {" "c}
Try
'Load information file
oRead = File.OpenText("myfile.inf")
Do Until oRead.EndOfStream
templine = oRead.ReadLine
'get first char from the line
k = Mid(templine, 1, 1)
If (k <> "*" And k <> " "c) Then
strInp(l) = Split(templine, vbTab)
l += 1
End If
Loop
' System.Text.RegularExpressions.Regex()
Catch ex As Exception
MsgBox(Convert.ToString(ex))
End
End Try
End Sub
|
|
|
|
|
joon52 wrote: Dim strInp() As Array = Nothing
Your array is nothing, and that's what the error is telling you.
Use an array only if you know exactly how many elements you will have. Otherwise, use ArrayList. You should create a typed array, if at all possible.
If you're just starting, you should go for VB.NET 2005, where you can specify a type for your list parameters, using the generic List class. You should never use ArrayList, it should have never existed.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
HI All - I few days ago I posed a question about this and got an answer, but in the end this particular method did not work for me. I have managed to find a way to do it and I thought I would share it. Hope this helps someone.
In the CellPainting event..........
Dim greenBackBrush As New SolidBrush(Color.LightGreen)
Dim gridBrush As New SolidBrush(Me.dgvAvail.GridColor)
Dim gridLinePen As New Pen(gridBrush)
Dim nsCellValue As Single = 0
Dim nsMaxValue As Single = 0
Dim sf As New StringFormat
sf.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.FitBlackBox
sf.LineAlignment = StringAlignment.Center
sf.Alignment = StringAlignment.Center
sf.Trimming = StringTrimming.None
'This cell shown Green
' Erase the cell.
e.Graphics.FillRectangle(greenBackBrush, e.CellBounds)
' Draw the grid lines (only the right and bottom lines;
' DataGridView takes care of the others).
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, _
e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, _
e.CellBounds.Bottom - 1)
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, _
e.CellBounds.Top, e.CellBounds.Right - 1, _
e.CellBounds.Bottom)
If Not (e.Value Is Nothing) Then
Dim g As Graphics = e.Graphics
Dim r As System.Drawing.Rectangle
r.Width = (e.CellBounds.Right - 2) - (e.CellBounds.Left + 2)
r.Height = (e.CellBounds.Bottom - 2) - (e.CellBounds.Top + 2)
r.X = e.CellBounds.X + 2
r.Y = e.CellBounds.Y + 2
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
e.Graphics.DrawString(CStr(nsCellValue), e.CellStyle.Font, Brushes.Black, r, sf)
r = Nothing
End If
See the article for the full subroutine code
-- modified at 13:41 Saturday 20th January, 2007
David Loring
!! Keep Music Live !!
|
|
|
|
|
Hello,
My customer wants to be able to update the program and download only the updates from the server.
The customer wants to install the application and then download updates when they are available. And install them without having to reinstall the program.
I started using the clickonce which works ok for this situation. However, the customer did not like this as it always installs in the default documents and setting directory, and the updates that are downloaded as the same size as the initial program size. As the updates are only small the customer only wants to download those updates so it will be quick to download and quick to install.
Is there another method to be able to do this, maybe some free third party, or can you configure the MSI to do this.
The customer would like something like norton anti-virus where only the updates are installed only.
Many thanks in advance,
Steve
|
|
|
|
|
Well it really all depends on what your application does. If you have to re-write code blocks & recompile your app then a re-install is the way to go. Remember that anti-virus products more often than not download updates to the virus definition library which is not hard-coded into the app itself but rather a resource that the app makes use of.
What is it that needs to be updated in your app? Is it a resource? If so then, yes, I think you could give your customer what he wants.
|
|
|
|
|
Hello,
I am creating a PDA application using the CF 2.0 that will use a datagrid and will display time in one of the columns. The column is called "ScheduledTime" and in the sql server 2005 database the datatype is datetime.
I would like to format the time to display e.g. 21:45 24hr format.
I think the datagrid is very limited when using the CF for mobile applications as the property "format" doesn't exist for this. See my code below.
I am wondering is there another way to format time in a datagrid column using the CF 2.0.
<vbcode>Me.grdSupportContracts.DataSource = ds.Tables(0)
Dim dgtbc As DataGridTextBoxColumn
dgtbc = CType(Me.grdSupportContracts.TableStyles(0).GridColumnStyles(3), DataGridTextBoxColumn)
dgtbc.Format 'Doesn't have the format property
Many thanks in advance,
Steve
|
|
|
|
|
Hello there
I have a little question...
I have seen many little apps that can retrieve your internet connection's username and password, for connections like ADSL, Dial-Up, VPN's, e.t.c.
So I'd like to ask if anyone knows how can I do that myself using VS2005 ???
|
|
|
|
|
how can i get the processorId using VB.NET
|
|
|
|
|
|
Hi Dear all
Would you please give me a sample code(s) that show(s) using of filter method in vb.net to limit datasource data? I dont want to use SQL instructions to do that, so if you have any suggestions to do that with vb.net code please help me.
Many Thanks
|
|
|
|
|
Mansourgh wrote: I dont want to use SQL instructions to do that
Why not ? You're asking 'how do I do things the hard and slow way' ?
you can iterate over your collection and knock out the items you don't want. There's no other way I can think of, filtering with SQL is supported on the code end as well as on the DB, but you don't want to use SQL for some strange reason.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to make a simple dictionary application that read the source from a delimited file, like using tab or comma and then store it into an array. I've tried using snippets, but it isn't working and doesn't look like what I want.
Please help me to make the code
Thanks
0011000011000001010101110100
|
|
|
|
|
my be you try like this
arr = split(stringToRead,urDelimeter)
|
|
|
|
|
Hello Evrybody...
I have a problem and I need help , I want to make a button to prevent writing in Textbox without changing its Backcolor or Forecolor and another button to open writing in the same Textbox without also changing the 2 previous colors .
thanks for all
-- modified at 14:28 Saturday 20th January, 2007
OK
when you use
Textbox1.Enaled = False
that will change the Font color and the back color of the textbox
I want to prevent writing in textbox without changing the font color or the back color
that is the problem
-- modified at 14:29 Saturday 20th January, 2007
soly
|
|
|
|
|
What do you mean? i don't understand it, please explain it more spesific.
|
|
|
|
|
I can't really understand your question, but you might try TextBox.Enabled = False .
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Handle the keypress event of your textbox. If you've turned off input, then set ea.Handled = true in the event, this rejects all keypresses.
The user interface you're designing is quite user hostile. Windows shows a textbox differently if it won't work for a reason.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Ok then, if you want to do so, these are the way:
- set the accepttab property of the textbox into False.
- And also set the acceptreturn property into false, too
- Add a code that move the focus into another control, like a cancel button when user click on the textbox.
PS: You can't avoid backcolor and forecolor of the textbox changed while the control is disabled. If you don't want it, so don't disable the textbox.
Experience is the best teacher
|
|
|
|