|
VB.NET 2005
I have some toolbar buttons on my "main" form that i would like to access from another form
Somehow, I have not been able to figure it out ...
Inside the Main window I can use
DriveEnable.pushed =true (where DriveEnable is the name of the actual button in the collection) and that works (of course )
In my module I'm using
Main.Drivenable.pushed =true .. but it does not work (no error either - just nothing happens)
I have set all "possible" properties of the toolbar tool / button(s) to Public - doesnt seem to help me ..
Whats the missing link ?
|
|
|
|
|
Assume Main is a form and not another module/class/object
Are you passing an instance of "Main" to your module.
EG calling the function in your module from the main form
dim oModule as new Module
oModule.CallFunction(me)
Public sub CallFunction(oFrm as Form)
oFrm.Drivenabled=true
end Sub
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I am using a datagrid in a ASP.NET page.
The data grid is inside a div tag.
<div id="divEditProjectRes" style="OVERFLOW: auto; HEIGHT: 150px">
<asp:datagrid id="dgEditResource" runat="server" Width="100%">
There is edit option in each row of the data grid and the user can edit on a few fields.
The grid has many records and the user has to scroll down.After scrolling to the record and clicking on edit there is a post back ,and the grid is set back to the top and he again has to scroll back to the row in which now fields are editable.
What I want here is that after he clicks on edit the same row must come at the top and the user need not scroll it again.
I have used the following code in dgEditResource_EditCommand to set focus to the editable text box in the particular scroll row ,Although it gets the focus but again we need to scroll down .
Dim descTB As TextBox
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("sdate_edit")
'Set the script to focus and select the TextBox
RegisterStartupScript("focus", "<script language=""JavaScript"">
vbTab & "Form2." & descTB.ClientID & ".focus();"
vbCrLf & vbTab & "Form2." & descTB.ClientID & ".select();" & "<" & "/script>")
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("percent_Edit")
If we press tab or space bar the record comes up as focus is already in the text box.
But I need that row to scroll up or navigate by itself after edit is clicked.
Thanks in advance.
Regards,
Sakshi
|
|
|
|
|
Please use the pre and code tags to make your code snippet more readable
nolnaH'O eteP - ".sepyt parc rof edoc t'nac ,yhsaw ,ybmap ybman ,ylriw ylrig ,pord dna gard eht morf slanoisseforp eht setarapes tahw s'ti sseug I"
|
|
|
|
|
Hi,
I want to print organizational chart in Crystal or any .Net 2005 solution.
e.g. Top Country Managers
City Managers
Area Managers
Sales officers
like a Hierarchy table.
Nasir Mahmood
|
|
|
|
|
Have you looked at any CR tutorials? This is pretty straightforward.
nolnaH'O eteP - ".sepyt parc rof edoc t'nac ,yhsaw ,ybmap ybman ,ylriw ylrig ,pord dna gard eht morf slanoisseforp eht setarapes tahw s'ti sseug I"
|
|
|
|
|
hi ,
i want to dial a phone number using windows default dialer.Can anybody have idea that, how can i perform this thing using vb.net ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
have you tried googling?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I am using
OS = Windows XP
Visual Basic Enterprise Edition 6
I have a problem in Printing in pre printed bill .
Bill Size
Height : 6 inches Width of paper : 9.1 inches
I wish to print bill by bill, Pre printed stationery is continious paper, I wish to print in one bill after one bill the paper automatically skip to other bill.
the problem is : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
Please go through the below three codes and help me fix paper size
==================================================================================
I used three codes to print . But problem contious. There is no paper size in VB for my paper setting ( height 6 inches , width 9.1 inches)
I used three methods to print one is
--------------------------------------------------------
Printer.ScaleMode = ScaleModeConstants.vbTwips
Printer.Width = 13104
Printer.Height = 8640
.............................
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Printer.EndDoc
Printer.NewPage
End Function
the above method while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
How can i set paper size of Height : 6 inches Width of paper : 9.1 inches
====================================================
2. Second code creating Text file and printing by creating text files one of my friend suggestes
=======================================================
Call modBillPrinter.OpenPrintFile
Call modBillPrinter.PrintPLine(Chr(12))
Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(cname), 15, ALIGN_LEFT) + Space(5) + MakeString(Trim(bno), 10, ALIGN_LEFT))
Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(place), 15, ALIGN_LEFT) + Space(5) + MakeString(bdate, 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))
Call modBillPrinter.PrintPLine(Space(5) + MakeString(" S.NO", 5, ALIGN_LEFT) + Space(3) + MakeString("Particulars", 20, ALIGN_LEFT) + Space(3) + MakeString("Grms", 6, ALIGN_RIGHT) + Space(3) + MakeString("Wastage", 7, ALIGN_RIGHT) + Space(3) + MakeString("Rate", 4, ALIGN_RIGHT) + Space(3) + MakeString("MC", 5, ALIGN_RIGHT) + Space(3) + MakeString("SC", 5, ALIGN_RIGHT) + Space(3) + MakeString("Amount", 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))
Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3); '8
Print #1, particulars; Spc(20 - Len(CStr(particulars))); '17
Print #1, Spc(9 - Len(CStr(grams))); grams; '7
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(11 - Len(CStr(trate))); trate; '7
Print #1, Spc(9 - Len(CStr(mc))); mc; '7
Print #1, Spc(8 - Len(CStr(sc))); sc; '7
Print #1, Spc(12 - Len(CStr(amount))); amount '11
Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)
modBillPrinter.ClosePrintReport
Shell App.Path & "\PRINT.BAT", vbHide
End Function
Here the problem is i cannot change font size ,
And i wish the usage of follwing for what following command used
1. Print #1, vbCr ?
2. Print #1, Chr(12)
3. Print #1, Spc(12
4. Print #1, vbCrLf
====================================================================
3 Third method - ( In this method no printing no out put in printer totally no print out
=====================================================================
Open "E:\jewelproject\DSREPO.TXT" For Output As #1
Call Header
psno = 1
While psno <= sno
If tcount > 5 Then
Print #1, Chr(12)
Call Header
tcount = 1
End If
mg1.Row = psno
mg1.Col = 2: particulars = mg1.Text
mg1.Col = 3: grams = mg1.Text
mg1.Col = 5: wastage = mg1.Text
mg1.Col = 6: trate = mg1.Text
mg1.Col = 7: mc = mg1.Text
mg1.Col = 8: sc = mg1.Text
mg1.Col = 9: amount = mg1.Text
Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3);
Print #1, particulars; Spc(17 - Len(CStr(particulars)));
Print #1, Spc(6 - Len(CStr(grams))); grams;
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(7 - Len(CStr(trate))); trate;
Print #1, Spc(7 - Len(CStr(mc))); mc;
Print #1, Spc(7 - Len(CStr(sc))); sc;
Print #1, Spc(11 - Len(CStr(amount))); amount
tcount = tcount + 1
psno = psno + 1
Wend
For i = 1 To 9 - tcount
Print #1, vbCr
Next i
Print #1, Spc(5); "Discount : "; disctxt.Text; Spc(5); "VAT : "; vattxt.Text
Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)
Close #1
'Shell App.Path & "\PRINT.BAT", vbHide
Shell "E:\jewelproject\PRINT.BAT", vbHide
'Shell "c:\1.txt", vbHide
End Function
Public Function Header()
cname = cnametxt.Text
bdate = datetxt.Text
place = cptxt.Text
bno = Bnotxt.Text
For i = 1 To 6: Print #1,: Next
Print #1, Spc(18); cname; Spc(42 - Len(Name)); bdate
Print #1, Spc(18); place; Spc(42 - Len(bno)); bno
Print #1, vbCrLf
Print #1, Spc(5); "Sl.No"; Spc(3); "Particulars"; Spc(6); " Grams";
Print #1, " Wastage"; Spc(3); "Rate"; Spc(3); "MC"; Spc(5); "SC"; Spc(6); "Amount"
Print #1, vbCrLf
My Problem : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.
1. How can i modify above code to fix paper size Height : 6 inches Width of paper : 9.1 inches
|
|
|
|
|
I'm new in vb.net .. i don't know how to display current date (ddmmyy) .. i try to find the command... but cannot find it.. plssss... anybody can help me?
|
|
|
|
|
Have a look at the DateTime class, its properties and methods, including ToString().
BTW: the fastest way to learn a new language is by reading a book about it...
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
You can try following
Now.date 'To print current date
also Format function is useful to print date in any format
|
|
|
|
|
I need to extract the value of the folowing column and put it in the startTime variable. This particular query only return one row. I am not sure how to do this and am getting the blue line under lpDataSet.tbl_teach_sched.ts_dayColumn.
startTime = lpDataSet.tbl_teach_sched.ts_dayColumn
|
|
|
|
|
Try something like this:
With lpDataSet.tbl_teach_sched("TableName") <br />
Dim dr As DataRow = .Rows(0)<br />
startTime = dr("ColumnName") <br />
End With
Where "TableName" and "ColumnName" are from your DataSet and DataRow properties.
Hope this points you in the right direction.
I don't speak Idiot - please talk slowly and clearly
|
|
|
|
|
I need code example how to use tcpclint in vb.net ,especially how to receive data?
|
|
|
|
|
How i can make my form design effectual, it means if i change my screen resolution the form change and the controls move accordingly?
many thanks
|
|
|
|
|
By using the dock and anchor properties ( mostly Anchor ) to make the form elements resize as you'd like when the form resizes.
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 )
|
|
|
|
|
Dock and anchor of the controls, LayoutPanel and TableLayout for arranging the controls in a nicely scaled or controlled formation.
|
|
|
|
|
Hello.
I'm making an Windows Installer, and am running into some problems with files not being found (and in turn, unsuccessful/incomplete installs). I think this may be due to my installer File System.
My question: What is the "targetDir" option used for in the below string, and what location exactly does "[TARGETDIR]/" point to? Can I extend this (e.g. "[TARGETDIR]/subdir1/")? If so, how?
"/targetDir="[TARGETDIR]/" /documentName="ExcelAddIn.xls" /assemblyName="ExcelAddIn.dll"
|
|
|
|
|
I am creating columns in a dataGrid. I know that I can loop through each row using a for each loop, but how do I make sure that the data from each row is in each column. Can someone tell me whether this will work.
The column ts_day stores each day of the week. So, the column will display Monday, then Tuesday, etc.
' This is the line of code that puts each row from the database in the column.<br />
lpDataSet.Tables(0).Columns.Add(New DataColum("lpDataSet.tbl_teach_sched.ts_dayColumn", GetType(String)))
<br />
' populate the data tables<br />
dtTeachSched = lpDataSet.Tables("tbl_teach_sched")<br />
<br />
' create the data columns<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Time", GetType(String))<br />
<br />
For Each row In dtTeachSched.Rows<br />
' This is the line of code that puts each row from the database in the column.<br />
lpDataSet.Tables(0).Columns.Add(New DataColum("lpDataSet.tbl_teach_sched.ts_dayColumn", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Notes", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Weeks", GetType(String)))<br />
Next
|
|
|
|
|
Sorry, but your question is very confusing to me. What are you trying to do? If you want a DataGridView to display from a DataTable, all you have to do is this:
dgvMyDataGridView.DataSource = dtMyDataTable
If you want the DataGridView to display additional columns after that, you could first add them to the DataTable and loop through the DataTable to fill it...is that what you were asking about??
Hope this helps.
|
|
|
|
|
I am creating a datagrid view from multiple database tables. This is how the dataGrid would be laid out. This same layout would exist for each day of the week that this teacher has a schedule.
Under the Monday column the names come from the students database table. The number of weeks comes from the student payments table. This shows how many weeks the student paid for this month. The note in the notes column comes from the the student payments table if the student had paid. If there is a cancelation or some other problem with the lesson that week then the note comes from the lesson status table. The blank row is a time that the teacher is available, but the time slot is empty.
The x's are times that the teacher is not available
Time | Monday | weeks | notes
12:00|john doe| --4-- | -pd- |
12:30|mary doe| --5-- | -pd- |
1:00-|buck doe| --4-- | ns+c |
1:30-|----x---|---x---|--x---|
2:00-|--------|-------|------|
I am using a tableAdapter for each database table but am used to using joins with php.
I have multiple questions.
1) would it be better for me to just do my own query with a join so that I don't have to use all these tableAdapters?
2) Or would it better for me to create a View in the database and query the view.
3) My original question was how do I assure that each day such as Monday, Tuesday, etc that the teacher has a schedule shows up as a column. Keep in mind that I can't simply show what is in one database table as you have shown above.
This is the line of code that I am not sure how it works. Will it increment through the database table rows and for each column that should have a day of the week displayed in it dispay that day of the week.
Here is the line of code.
lpDataSet.Tables(0).Columns.Add(New DataColumn("lpDataSet.tbl_teach_sched.ts_dayColumn", GetType(String)))
This is the code that pupulates that column with a row from the database such as Monday or Tuesday.
lpDataSet.tbl_teach_sched.ts_dayColumn
Keep in mind that when you query this database table for this column it would look like this. The following example is for a teacher that works on monday, Tuesday, Wednesday and Friday.
ts_id | ts_day | teach_id
| |
1 | Monday | 100
2 | Tuesday | 100
3 | Wednesday | 100
4 | Friday | 100
|
|
|
|
|
This is tricky because you are taking a table that flows vertically and changing it to view horizontally....you will probably have to pull the "Day" table separately....then loop through the day table and add a new column to the grid for each day. then you will have to loop through the rows to populate the data in this new column. Does this help?
|
|
|
|
|
I know that this is how I have to do it. The question I have that I need answered is what line of code represents row one of the ss_day column and how do I increment this code within the loop.
I know I increment the loop by using dtTeachSched.Rows.
I need to know if this line of code will show me each ts_day row as the loop increments.
lpDataSet.tbl_teach_sched.ts_dayColumn
This is how I have my loop written now.
For Each row In dtTeachSched.Rows<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Notes", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Weeks", GetType(String)))<br />
Next
|
|
|
|
|
I'm still not sure I know what you are asking...you need to remember that we don't know your table structures and naming conventions so it's hard to understand what you mean when you say things like "what line of code represents row one of the ss_day column"... So this is what I'm thinking you are asking...
You have a table of days that a teacher has on his/her schedule. You loop through this table and for each day in it, you add a column to another table (we'll call it table 2). Now you want to know how to access the new columns in table 2 and fill them with data? Right?
Well, for each day that you add a column for, you are going to have name the column something different. I do not think you are even allowed to add two columns to a table with the same name. Then you will access the data by refering to that name. For example, you may do something like this:
Dim intCount as Integer = 0<br />
For Each row as DataRow In dtTeachSched.Rows<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Day_" & intCount, GetType(String)))<br />
Next
Then when you are ready to fill the data in later, you would access data the first row of the first new column like this:
strDataFromNewColumn = lpDataSet.Tables(0).Row(0)("Day_1")
I hope this helps point you in the right direction.
|
|
|
|
|