|
I don't think you can, I think you need to download something like Advanced Installer to do an msi.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
Great resource you guys have here.
I'm doing a database entry project and want to lock down all the fields on the form until the user is in update or add mode. I have a mix of textboxes, drop down lists, radio buttons, and dateTimePickers. I can lock down the textboxes by capturing the KeyPress event, but this did not work for the maskedTextBox, which is VERY annoying. And doesn't work with the other components and doesn't stop mouse access.
Does anyone know of a technique that I can use to lock down all of the controls on the form? I was setting the enabled property of each control but it grays out the text and I don't like the way it looks, either does the user!
All advice is appreciated!
RayG
|
|
|
|
|
Well, the enabled property is there for that, and as you say, the UI makes clear to the end user that a control is disabled by greying it out. If you don't like the default windows behaviour, then you probably want to create your own classes derived from the controls, and write code based on a custom property to reject keyboard and mouse events. But, I think it's nasty. It means your UI doesn't show the user that they can't interact with the controls, that's why they look the way they do when disabled.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's only the ReadOnly for textbox and Enabled for the rest of the controls.
I don't like the dark-gray on gray color scheme when some of the controls are disabled too but so far haven't got users complained about color....
|
|
|
|
|
Hi
I am looping through a Datagridview row by row in an effort to first of all write to a database while also firing a PrintPage event. When the grid contains multiple rows, it loops through just fine when writing all values to the DB. The PrintPage event is also fired the correct number of times as determined by the rowcount but always contains the details of the first row rather than the values of all other rows. Code as follows:
'================================================================<br />
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click<br />
Dim x As Int32 = 0<br />
Try<br />
Dim oCmd As New SqlCommand()<br />
Dim Type As String = ""<br />
oCmd = New SqlCommand<br />
For x = 0 To dgvDetails.RowCount - 1<br />
With oCmd<br />
.Connection = oDBCon<br />
Type = dgvDetails.Item(4, x).Value<br />
.CommandText = "INSERT INTO Table Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10,Value11) " + _<br />
"VALUES ('" & Value1.Text & "', '" & Value2.Text & "', '" & Value3.Text & "', '" & Value4.Text & "', '" & Value5.Item(0, x).Value & "'," + _<br />
"'" & Value6.Item(1, x).Value & "', '" & Value7.Item(2, x).Value & "', '" & Value8.Item(3, x).Value & "', '" & Type.Substring(0, 1) & "'," + _<br />
"'" & FormatDateTime(Now, DateFormat.ShortDate) & "', '" & My.Settings.FullName & "')"<br />
.ExecuteNonQuery()<br />
End With<br />
Dim diaPrintDocs As New Printing.PrintDocument<br />
diaPrintDocs = PreparePrintDocument()<br />
diaPrintDocs.Print()<br />
diaPrint.Dispose()<br />
Next<br />
End Try<br />
End Sub<br />
'================================================================
PreparePrintDocument is a function that is called to handle the addressing of the printing output - extract below. Basically, a new PrintPage event needs to be triggered each time it loops through this sub above and at no time will there be a need for continuous pages, just a new page for each row within the DGV. For some reason, that is currently not happening.
'================================================================<br />
Dim x As Int32<br />
With e.Graphics<br />
.DrawImage(oLogoY, 275, 120)<br />
.DrawString("TEXT:", oBF, Brushes.Black, 500, 110)<br />
.DrawString(tbxBillNo.Text, oBF, Brushes.Black, 580, 110)<br />
.DrawString("TEXT", oBF, Brushes.Black, 100, 150)<br />
.DrawString("TEXT", oBF, Brushes.Black, 140, 170)<br />
.DrawString("TEXT", oBF, Brushes.Black, 500, 150)<br />
.DrawString("TEXT", oBF, Brushes.Black, 510, 170)<br />
.DrawString("TEXT", oTF, Brushes.Black, 80, 270)<br />
.DrawString("TEXT", oLF, Brushes.Black, 80, 330)<br />
.DrawString("TEXT", oLF, Brushes.Black, 80, 360)<br />
.DrawString(dgvDetails.Item(0, x).Value, oBF, Brushes.Black, 165, 359)<br />
End With<br />
'================================================================
Would anyone possibly have some ideas on how to address this issue? Help would be greatly appreciated.
|
|
|
|
|
Hi guys not exactly sure if parsing is the right terminology but I was wondering if someone can help me understand what I need to do. Here is what I hope my program to do...and also where I am stuck.
The program should be very simple containing only 1 textbox, 1 button, and one label to display the result.
The object of the program is to assign a number to each letter in the alphabet for example a=1 b=2 c=3 etc. and then calculate the textbox based on the letters it contains. the display the result in label1.text
when u fill in the textbox and press the button I want to be able to read the textbox value and parse each letter so that they can be added up based on their number value
right now on my form I have
Dim aa as integer = 1
dim bb as integer = 2
all the way to zz
Dim zz as integer = 26
in the button I have only
dim calctext as string = textbox1.text
now i guess i need to parse calctext somehow and store their values or add them directly. Just not sure where to start here and what the best way would be.
I guess my last question is on the form where i delcared aa and bb as integers etc. I used double letters like aa and bb because I didn't know if there would be conflict later on with the parsed variables...would there be?
Thanks in advance guys for any input...I'd appreciate a nudge in the right direction for the commands I should use. I learn best by trying.
|
|
|
|
|
1. First you should store the corresponding alphabet and number pair in a Dictionary. Not saying defining them from aa to zz won't work, but using Dictionary allows you to expand later on. You need to initialize the Dictionary, though.
2. Then you should break down the text in the textbox into an array of char (or string). You can use List for that too.
3. You go through the array of char or string, find the corresponding alphabet in the Dictionary, get the integet number assigned, and add the number to a count.
4. Display the count in the label.
|
|
|
|
|
Hi and thankyou very much for the response...but I am sorry maybe I didn't express my needs properly. I understand I need to breakdown the textbox into seperate letters...I just don't know the command I should be using...is it PARSE? or split or what...i'm just lost I don't know if I'll ever get this there is so much to know.
|
|
|
|
|
You can use a loop and SubString to go thru each char (as string), or you can use .Text.ToCharArray to generate an array of char, then go thru the array of char.
|
|
|
|
|
hi,
please help me, i want to make an application which implement linq features (linq to sql,linq to object and linq to xml) nah, what kind of application would be best for it ? since i have to use xml (linq to xml), is that mean i have to build a web application ? please help me for idea... any suggestion will be a great help.
thank you very much,
ganero
|
|
|
|
|
ganero wrote: since i have to use xml (linq to xml), is that mean i have to build a web application ?
This question tells me you want to play with LINQ for the sake of it, but don't have a grasp on basics. No, XML is not web only.
I'd recommend working through a beginner book and doing hte LINQ chapter when you get to it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks Christ, yes like you said, i want to experiment linq but i need to implement it in one application ( 'I MUST BUILD an APPLICATION' ) and so the problem is i don't know what to make... i mean, idea, if you don't mind, i'm asking for a application title - could you give me some ?
thank you
|
|
|
|
|
I have a list box and a combo box that both allow you to
select a teachers name from a list. They are on different panels that show on the form at different times. I created a dataTable named dtTeachName that only holds the teacher name and id. I am attempting to populate both of these controls with the saem information. At first I loaded both of these from the same dataTable, but when I do that the teacher names will dissapear in the list box. I even put an if statement that said that that list box wont populate unless the panel it is on is visible. When I do that the program freezes.
Has anyone run into this problem before?
Here is my code.
' fill the teachers checked list box
cboSelectTeacher.DataSource = dtTeachName
cboSelectTeacher.DisplayMember = "teach_name"
cboSelectTeacher.ValueMember = "teach_id"
' fill the teachers checked list box
lstTeachers.DataSource = dtTeachName
lstTeachers.DisplayMember = "teach_name"
lstTeachers.ValueMember = "teach_id"
|
|
|
|
|
You can't bind two controls to the same source, you need to make a copy.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How do I make a copy? Do I just do another query or literally make a copy?
|
|
|
|
|
you can use the CLone method to make a copy, I believe that makes a deep copy. Otherwise, you'd run your query again, but I'd try Clone() first.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I tried to run the query again and the program still freezes. When I ran the query again I also populated a completely different dataTable and it still didn't work. Then I tried to create a clone of the original dataTable and then the list box will populate and the program does not freeze, but the combo box does not populate.
|
|
|
|
|
The app freezing is not a typical symptom of what goes wrong when you reuse a datasource. Usually changing one control just causes te other to change too. My guess is that you're not cloning it properly, and your source is empty. And, I would guess that you have code running on a selected index change which is being run by the databinding, and causing it ti freeze. If you break out or if you set breakpoints around the related code when you debug, wat happens ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Right now it is not freezing. I just need to figure out how to populate this combo box with the teacher names.
Here is my code for cloning the datasource. I tried doing it several ways.
' query
tableName = "tbl_teachers"
dtTeachName = generalQuery()
' fill the teachers checked list box
lstTeachers.DataSource = dtTeachName
lstTeachers.DisplayMember = "teach_name"
lstTeachers.ValueMember = "teach_id"
cboSchedDur.SelectedItem = "This Week"
'End If
' fill the teachers checked list box
dtTNameClone = dtTeachName.Clone()
cboSelectTeacher.DataSource = dtTNameClone
cboSelectTeacher.DisplayMember = "teach_name"
cboSelectTeacher.ValueMember = "teach_id"
|
|
|
|
|
does dtTeachName contain any data ? If it does, it should be showing.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It does show data. I populated another list box from the data, but when I make the copy it does not fill the combo box.
The list box and the combo box are filled in 2 different sub procedures. The dataTables that I am using are declared globally in a module as public.
|
|
|
|
|
AAGTHosting wrote: The dataTables that I am using are declared globally in a module as public.
Well, they should exist solely for the control that's using them, making one global like htat is a poor design.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I tried declaring local dataTables and it still does not work. I just ran the same query again and the list box populated, but when I click on the students button to go to that panel all the controls on the panel do not come up.
Here is my query. Would it be better for me to use a GetDataBy query instead of a fillBy? The GetDataBy method returns a dataTable.
|
|
|
|
|
Where is your query ?
Sounds like what you're really saying is that you have a button event which is not working, have you set a breakpoint in there ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This only seems to happen when I try to populate the second teacher list box. If I comment out the code to bind a source to the teacher combo box then only the first name on the list of teachers shows up in the teacher list box, then when I click on the students button one of my list boxes shows up, that is not filled dynamically and you can't select a type of student.
Should I use multiple datasets so I don't have multiple controls getting info from the tables in the dataset?
|
|
|
|
|